diff --git a/docs/ko/diffusion/stable_diffusion/sampler/ddim.html b/docs/ko/diffusion/stable_diffusion/sampler/ddim.html index c617e51..093c5e4 100644 --- a/docs/ko/diffusion/stable_diffusion/sampler/ddim.html +++ b/docs/ko/diffusion/stable_diffusion/sampler/ddim.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - Denoising Diffusion Implicit Models (DDIM) Sampling + 노이즈 제거 디퓨전 암시적 모델 (DDIM) 샘플링 @@ -72,8 +72,8 @@ -

Denoising Diffusion Implicit Models (DDIM) Sampling

-

This implements DDIM sampling from the paper Denoising Diffusion Implicit Models

+

노이즈 제거 디퓨전 암시적 모델 (DDIM) 샘플링

+

이 페이지는 Denoising Diffusion Implicit Models 논문의 DDIM 샘플링을 구현합니다.

@@ -92,10 +92,10 @@

Denoising Diffusion Implicit Models (DDIM) Sampling

-

DDIM Sampler

-

This extends the DiffusionSampler - base class.

-

DDPM samples images by repeatedly removing noise by sampling step by step using,

+

DDIM 샘플러

+

이는 DiffusionSampler + 기본 클래스를 확장합니다.

+

DDIM은 단계별 샘플링을 반복하여 노이즈를 제거하여 이미지를 샘플링합니다.

where is random noise, is a subsequence of of length , and +στiϵτi

위 식의 은 랜덤 노이즈, 은 길이 로 이루어진 부분수열입니다.

-

Note that, in DDIM paper refers to from DDPM.

+

주의해야할 점은, DDIM 논문의 DDPM 입니다 .

@@ -180,15 +180,15 @@

DDIM Sampler

#
+ 는 로 쓰며, 를 계산하기 위해 사용됩니다. 은 표본 추출 과정을 결정론적(deterministic)으로 만듭니다.
@@ -211,7 +211,7 @@

DDIM Sampler

-

Number of steps,

+

는 스텝 수 입니다

@@ -223,7 +223,7 @@

DDIM Sampler

-

Calculate to be uniformly distributed across

+

가 균일하게 분포되도록 를 계산합니다.

@@ -237,7 +237,7 @@

DDIM Sampler

-

Calculate to be quadratically distributed across

+

가 이차(quadratically)적으로 분포되도록 를 계산합니다.

@@ -254,7 +254,7 @@

DDIM Sampler

-

Get

+

을 가져옵니다.

@@ -367,23 +367,23 @@

DDIM Sampler

-

Sampling Loop

-
@@ -405,7 +405,7 @@

Sampling Loop

-

Get device and batch size

+

디바이스와 배치 크기를 가져옵니다

@@ -418,7 +418,7 @@

Sampling Loop

-

Get

+

를 가져옵니다

@@ -430,7 +430,7 @@

Sampling Loop

-

Time steps to sample at

+

에 대해 무작위 추출을 위한 타임 스텝을 정합니다

@@ -444,7 +444,7 @@

Sampling Loop

-

Index in the list

+

인덱스 는 리스트 안에 있습니다

@@ -456,7 +456,7 @@

Sampling Loop

-

Time step

+

타임 스텝 입니다

@@ -468,7 +468,7 @@

Sampling Loop

-

Sample

+

를 샘플링 합니다

@@ -484,7 +484,7 @@

Sampling Loop

-

Return

+

를 반환합니다.

@@ -496,28 +496,28 @@

Sampling Loop

-

Sample

+

무작위로 추출하기

+ 은 빈 프롬프트 에 대한 조건부 임베딩 입니다.
@@ -534,7 +534,7 @@

Sample

+

를 가져옵니다

@@ -548,7 +548,7 @@

Sample and predicted

+

을 계산하고 를 예측합니다.

@@ -574,7 +574,7 @@

Sample given

+

주어진 에 대해서 를 무작위로 추출하기

@@ -647,7 +647,7 @@

Sample ,

@@ -715,7 +715,7 @@

Sample

+

에서 무작위로 추출하기

+ 은 노이즈 입니다.
@@ -851,7 +851,7 @@

Sample from

@@ -922,7 +922,7 @@

Painting Loop

-

Get batch size

+

배치 크기를 구합니다

@@ -934,7 +934,7 @@

Painting Loop

-

Time steps to sample at

+

에서 무작위 추출을 위한 타임 스텝입니다.

@@ -948,7 +948,7 @@

Painting Loop

-

Index in the list

+

리스트 안에 있는 인덱스 입니다.

@@ -960,7 +960,7 @@

Painting Loop

-

Time step

+

타임 스텝 입니다.

@@ -972,7 +972,7 @@

Painting Loop

-

Sample

+

을 무작위 추출합니다.

@@ -986,7 +986,7 @@

Painting Loop

-

Replace the masked area with original image

+

원본 이미지의 마스크된 부분을 바꿉니다.

@@ -998,7 +998,7 @@

Painting Loop

-

Get the for original image in latent space

+

latent 스페이스에 있는 원본이미지를 위해 을 가져옵니다.

@@ -1010,7 +1010,7 @@

Painting Loop

-

Replace the masked area

+

마스크 된 부분을 바꿉니다.

diff --git a/docs/ko/gan/wasserstein/gradient_penalty/readme.html b/docs/ko/gan/wasserstein/gradient_penalty/readme.html index ba9938b..4a96ae0 100644 --- a/docs/ko/gan/wasserstein/gradient_penalty/readme.html +++ b/docs/ko/gan/wasserstein/gradient_penalty/readme.html @@ -1,26 +1,26 @@ - + - + - + - + - + - + - Gradient Penalty for Wasserstein GAN (WGAN-GP) + Wasserstein GAN(WGAN-GP)에 대한 GAN 패널티 @@ -72,11 +72,11 @@ -

Gradient Penalty for Wasserstein GAN (WGAN-GP)

-

This is an implementation of Improved Training of Wasserstein GANs.

-

WGAN suggests clipping weights to enforce Lipschitz constraint on the discriminator network (critic). This and other weight constraints like L2 norm clipping, weight normalization, L1, L2 weight decay have problems:

-

1. Limiting the capacity of the discriminator 2. Exploding and vanishing gradients (without Batch Normalization).

-

The paper Improved Training of Wasserstein GANs proposal a better way to improve Lipschitz constraint, a gradient penalty.

+

Wasserstein GAN(WGAN-GP)에 대한 GAN 패널티

+

This is an implementation of Wasserstein GANs의 향상된 훈련 방법 논문에 대한 구현입니다.

+

WGAN 는 판별기 네트워크(critic)에서 립시츠 제약을 적용하기 위해 가중치를 클리핑할것을 제안합니다. 이와 L2 정규 클리핑, 가중치 정규화, L1, L2 가중치 감소와 같은 다른 가중치 제약은 문제가 있습니다 :

+

1. 판별기의 용량 제한 2. 그래디언트의 폭발 및 소멸 (배치 정규화없이).

+

Wasserstein GANs의 향상된 훈련 방법 논문은 기울기 패널티인 립시츠 제약을 개선하는 더 나은 방법을 제안합니다.

diff --git a/docs/ko/gan/wasserstein/readme.html b/docs/ko/gan/wasserstein/readme.html index 35ca51b..28fcfd1 100644 --- a/docs/ko/gan/wasserstein/readme.html +++ b/docs/ko/gan/wasserstein/readme.html @@ -1,5 +1,5 @@ - + @@ -62,7 +62,7 @@

- View code on Github + 깃헙에서 코드보기

@@ -72,7 +72,7 @@ #

Wasserstein GAN - WGAN

-

This is an implementation of Wasserstein GAN.

+

Wasserstein GAN논문의 구현입니다.

diff --git a/docs/ko/hypernetworks/experiment.html b/docs/ko/hypernetworks/experiment.html index f245026..04f3737 100644 --- a/docs/ko/hypernetworks/experiment.html +++ b/docs/ko/hypernetworks/experiment.html @@ -1,5 +1,5 @@ - + @@ -61,7 +61,7 @@

- View code on Github + 깃헙에서 코드보기

@@ -90,7 +90,7 @@ -

Auto regressive model

+

자동 회귀 모형

@@ -114,7 +114,7 @@

Auto regressive model

-

Token embedding module

+

토큰 임베딩 모듈

@@ -140,8 +140,8 @@

Auto regressive model

-

Embed the tokens (src -) and run it through the the transformer

+

토큰 (src +)을 내장하고 트랜스포머를 통해 실행합니다.

@@ -153,7 +153,7 @@

Auto regressive model

-

Generate logits of the next token

+

다음 토큰의 로짓(logit)을 생성합니다.

@@ -165,8 +165,8 @@

Auto regressive model

-

Configurations

-

The default configs can and will be over-ridden when we start the experiment

+

설정값

+

기본 설정은 실험을 시작할 때 재정의될 수 있고 또한 재정의될 것입니다.

@@ -194,7 +194,7 @@

Configurations

-

Initialize the auto-regressive model

+

자동 회귀 모델 을 초기화합니다

@@ -240,7 +240,7 @@

Configurations

-

Create experiment

+

실험을 생성합니다

@@ -252,7 +252,7 @@

Configurations

-

Create configs

+

설정값을 생성합니다

@@ -264,7 +264,7 @@

Configurations

-

Load configurations

+

설정값을 불러옵니다

@@ -276,7 +276,7 @@

Configurations

-

A dictionary of configurations to override

+

재설정하기 위한 설정값이 담긴 딕셔너리 입니다.

@@ -303,7 +303,7 @@

Configurations

-

Set models for saving and loading

+

모델 저장과 불러오기를 위해 설정합니다.

@@ -315,7 +315,7 @@

Configurations

-

Start the experiment

+

실험을 시작합니다

diff --git a/docs/ko/hypernetworks/hyper_lstm.html b/docs/ko/hypernetworks/hyper_lstm.html index 578d43a..e7e8d30 100644 --- a/docs/ko/hypernetworks/hyper_lstm.html +++ b/docs/ko/hypernetworks/hyper_lstm.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - HyperNetworks - HyperLSTM + 하이퍼 네트워크 - 하이퍼 LSTM @@ -61,7 +61,7 @@

- View code on Github + 깃헙에서 코드 보기

@@ -70,20 +70,20 @@ -

HyperNetworks - HyperLSTM

+

하이퍼 네트워크 - 하이퍼 LSTM

We have implemented HyperLSTM introduced in paper HyperNetworks, with annotations using PyTorch. This blog post by David Ha gives a good explanation of HyperNetworks.

We have an experiment that trains a HyperLSTM to predict text on Shakespeare dataset. Here's the link to code: experiment.py

Open In Colab

HyperNetworks use a smaller network to generate weights of a larger network. There are two variants: static hyper-networks and dynamic hyper-networks. Static HyperNetworks have smaller networks that generate weights (kernels) of a convolutional network. Dynamic HyperNetworks generate parameters of a recurrent neural network for each step. This is an implementation of the latter.

-

Dynamic HyperNetworks

-

In a RNN the parameters stay constant for each step. Dynamic HyperNetworks generate different parameters for each step. HyperLSTM has the structure of a LSTM but the parameters of each step are changed by a smaller LSTM network.

-

In the basic form, a Dynamic HyperNetwork has a smaller recurrent network that generates a feature vector corresponding to each parameter tensor of the larger recurrent network. Let's say the larger network has some parameter the smaller network generates a feature vector and we dynamically compute as a linear transformation of . For instance where is a 3-d tensor parameter and is a tensor-vector multiplication. is usually a linear transformation of the output of the smaller recurrent network.

-

Weight scaling instead of computing

-

Large recurrent networks have large dynamically computed parameters. These are calculated using linear transformation of feature vector . And this transformation requires an even larger weight tensor. That is, when has shape , will be .

-

To overcome this, we compute the weight parameters of the recurrent network by dynamically scaling each row of a matrix of same size.

-

where is a parameter matrix.

-

We can further optimize this when we compute , as where stands for element-wise multiplication.

+

동적 하이퍼네트워크

+

RNN에서 매개변수는 각 단계에 대해 일정하게 유지됩니다. 동적 하이퍼네트워크는 각 단계마다 다른 파라미터를 생성합니다. 하이퍼LSTM은 LSTM의 구조를 갖지만 각 단계의 파라미터는 더 작은 LSTM 네트워크에 의해 변경됩니다.

+

기본 형태에서 동적 하이퍼네트워크는 더 큰 반복 네트워크의 각 파라미터 텐서에 대응하는 특징 벡터를 생성하는 더 작은 반복 네트워크를 가지고 있습니다. 더 큰 네트워크가 어떤 매개변수 를 가지고 있다고 가정합니다.더 작은 네트워크는 특징 벡터 을 생성하고 동적으로 의 선형 변환으로 계산합니다. 예를 들면 여기에서 는 3차원 텐서 매개변수이고, 는 텐서-벡터 곱셈 기호입니다. 은 일반적으로 더 작은 순환 신경망의 출력을 선형으로 변환합니다.

+

계산 대신 가중치 확장하기

+

대규모 순환 신경망은 동적으로 계산된 파라미터가 큽니다. 이들은 특징 벡터 의 선형 변환을 사용하여 계산합니다. 그리고 이 변환은 훨씬 더 큰 가중치 텐서를 필요로합니다. 즉 다시 말하면, , 의 크기라면, 이것은 이 됩니다.

+

이를 극복하기 위해 동일한 크기의 행렬의 각 행을 동적으로 스케일링하여 순환 신경망의 가중치 매개변수를 계산합니다.

+

여기에서 크기의 매개변수 행렬입니다.

+

위 식은 을 아래의 식으로 계산하면 최적화할 수 있습니다. 위 식의 는 element-wise 곱셈입니다.

@@ -102,7 +102,7 @@

Weight scaling instead of computing

#

HyperLSTM Cell

-

For HyperLSTM the smaller network and the larger network both have the LSTM structure. This is defined in Appendix A.2.2 in the paper.

+

하이퍼LSTM의 경우 작은 네트워크와 큰 네트워크 모두 LSTM 구조를 갖습니다. 이는 논문의 부록 A.2.2에 정의되어 있습니다.

@@ -115,12 +115,12 @@

HyperLSTM Cell

#

input_size - is the size of the input , hidden_size - is the size of the LSTM, and hyper_size - is the size of the smaller LSTM that alters the weights of the larger outer LSTM. n_z - is the size of the feature vectors used to alter the LSTM weights.

-

We use the output of the smaller LSTM to compute , and using linear transformations. We calculate , , and from these, using linear transformations again. These are then used to scale the rows of weight and bias tensors of the main LSTM.

-

📝 Since the computation of and are two sequential linear transformations these can be combined into a single linear transformation. However we've implemented this separately so that it matches with the description in the paper.

+ 은 입력값의 크기 를, hidden_size + 은 LSTM의 크기를, 그리고 hyper_size + 는 더 큰 외부 LSTM의 가중치를 변경하는 더 작은 LSTM의 크기입니다. n_z + 은 LSTM 가중치를 변경하는 데 사용되는 특징 벡터의 크기입니다.

+

더 작은 LSTM의 결과값을 선형 변환을 이용하여 , 그리고 을 계산하기 위해서 사용합니다. , , 그리고 을 계산합니다. 이것들 중에서, 다시 선형 변환을 사용합니다. 그리고 나서 이것들은 메인 LSTM의 가중치 및 바이어스 텐서의 행을 확장하는 데 사용됩니다.

+

📝 의 계산은 두개의 순차 선형 변환이므로 이들은 단일 선형 변환으로 결합 될 수 있습니다. 하지만 논문의 설명과 일치하도록 이를 각각 별도로 구현했습니다. a.

@@ -143,9 +143,9 @@

HyperLSTM Cell

-

The input to the hyperLSTM is where is the input and is the output of the outer LSTM at previous step. So the input size is hidden_size + input_size -.

-

The output of hyperLSTM is and .

+

하이퍼LSTM의 입력값은 아래와 같습니다. 여기에서 은 입력값이고 은 이전 단계의 외부 LSTM의 결과값입니다. 따라서 입력값의 크기는 hidden_size + input_size +입니다.

+

하이퍼LSTM의 출력은 입니다.

@@ -157,7 +157,7 @@

HyperLSTM Cell

-

🤔 In the paper it was specified as I feel that it's a typo.

+

🤔 논문에서는 아래와 같이 서술되었습니다. 이건 타이핑 오류로 보여집니다.

@@ -232,7 +232,7 @@

HyperLSTM Cell

-

The weight matrices

+

가중치 행렬 입니다.

@@ -244,7 +244,7 @@

HyperLSTM Cell

-

The weight matrices

+

가중치 행렬 입니다.

@@ -256,7 +256,7 @@

HyperLSTM Cell

-

Layer normalization

+

레이어 정규화를 합니다.

@@ -342,7 +342,7 @@

HyperLSTM Cell

-

We calculate , , and in a loop

+

한 반복 단위에서 , , , 을 계산합니다.

@@ -433,7 +433,7 @@

HyperLSTM Cell

-

HyperLSTM module

+

HyperLSTM 모듈

@@ -445,8 +445,8 @@

HyperLSTM module

-

Create a network of n_layers - of HyperLSTM.

+

n_layers + 로 된 하이퍼LSTM 네트워크를 생성합니다.

@@ -469,7 +469,7 @@

HyperLSTM module

-

Store sizes to initialize state

+

상태를 초기화하기 위해 크기를 저장합니다.

@@ -483,7 +483,7 @@

HyperLSTM module

-

Create cells for each layer. Note that only the first layer gets the input directly. Rest of the layers get the input from the layer below

+

각 레이어를 위한 셀(cell)들을 생성합니다. 오직 첫번째 레이어만이 입력값 그대로를 입력으로 받는 것을 주목하세요. 다음 레이어들은 그 전의 레이어에서 입력값을 가져옵니다.

@@ -501,9 +501,7 @@

HyperLSTM module

has shape [n_steps, batch_size, input_size] and
  • state - is a tuple of . have shape [batch_size, hidden_size] - and have shape [batch_size, hyper_size] -.
  • + 는 . 는 튜플로, [batch_size, hidden_size]의 크기를 갖습니다. 그리고 [batch_size, hyper_size] 의 크기를 갖습니다.
    @@ -527,7 +525,7 @@

    HyperLSTM module

    -

    Initialize the state with zeros if None +

    만약 None 값이면, 상태를 0으로 초기화합니다.

    @@ -557,8 +555,8 @@

    HyperLSTM module

    -

    Reverse stack the tensors to get the states of each layer

    -

    📝 You can just work with the tensor itself but this is easier to debug

    +

    각 레이어의 상태를 얻기 위해 텐서를 반대로 쌓습니다.

    +

    📝 텐서 그 자체로도 작동될 수 있지만, 이 방법이 디버깅하기 더 쉽습니다.

    @@ -571,7 +569,7 @@

    HyperLSTM module

    -

    Collect the outputs of the final layer at each step

    +

    각 스텝의 마지막 레이어의 결과를 리스트에 추가합니다.

    @@ -584,7 +582,7 @@

    HyperLSTM module

    -

    Input to the first layer is the input itself

    +

    첫번째 레이어의 입력값은 입력값 그 자체입니다.

    @@ -596,7 +594,7 @@

    HyperLSTM module

    -

    Loop through the layers

    +

    레이어를 돌면서 반복합니다.

    @@ -608,7 +606,7 @@

    HyperLSTM module

    -

    Get the state of the layer

    +

    레이어의 상태를 가져옵니다.

    @@ -621,7 +619,7 @@

    HyperLSTM module

    -

    Input to the next layer is the state of this layer

    +

    지금 레이어의 상태가 다음 레이어의 입력값입니다.

    @@ -633,7 +631,7 @@

    HyperLSTM module

    -

    Collect the output of the final layer

    +

    마지막 레이어의 결과 을 모읍니다.

    @@ -645,7 +643,7 @@

    HyperLSTM module

    -

    Stack the outputs and states

    +

    결과와 상태를 저장합니다.

    diff --git a/docs/ko/hypernetworks/index.html b/docs/ko/hypernetworks/index.html index 543084a..f042079 100644 --- a/docs/ko/hypernetworks/index.html +++ b/docs/ko/hypernetworks/index.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - HyperNetworks + 하이퍼네트워크 @@ -61,7 +61,7 @@

    - View code on Github + 깃헙에서 코드보기

    @@ -70,7 +70,7 @@ -

    HyperLSTM

    +

    하이퍼LSTM

    diff --git a/docs/ko/neox/samples/finetune.html b/docs/ko/neox/samples/finetune.html index 3f543bd..d8318f2 100644 --- a/docs/ko/neox/samples/finetune.html +++ b/docs/ko/neox/samples/finetune.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - Fine Tune GPT-NeoX + GPT-NeoX 파인 튜닝 @@ -62,7 +62,7 @@

    - View code on Github + 깃헙에서 코드 보기

    @@ -71,8 +71,8 @@ -

    Fine Tune GPT-NeoX

    -

    This shows how to fine tune GPT-NeoX with pipeline parallelism.

    +

    GPT-NeoX 파인 튜닝

    +

    파이프라인 병렬화로 GPT-NeoX 파인 튜닝하는 법에 대해 서술합니다.

    @@ -99,7 +99,7 @@

    Fine Tune GPT-NeoX

    -

    Load GPT-NeoX layers

    +

    GPT-NeoX 레이어를 불러옵니다

    @@ -126,7 +126,7 @@

    Load GPT-NeoX layers

    -

    Create fine tuner for biases

    +

    바이어스를 위한 파인 튜너 생성하기

    @@ -150,7 +150,7 @@

    Create fine tuner for biases

    -

    Mark biases as trainable

    +

    바이어스를 학습가능한 상태로 설정합니다.

    @@ -174,7 +174,7 @@

    Create fine tuner for biases

    -

    Create pipeline parallel model

    +

    파이프라인 병렬 모델 생성하기

    @@ -201,7 +201,7 @@

    Create pipeline parallel model

    -

    Make sure the finetuner is initialized

    +

    파인 튜너가 초기화 되었는지 확인합니다.

    @@ -213,7 +213,7 @@

    Create pipeline parallel model

    -

    Create the Pipe module

    +

    파이프 모듈을 생성합니다.

    @@ -225,7 +225,7 @@

    Create pipeline parallel model

    -

    Get the layer distribution across GPUs

    +

    GPU들에 대한 레이어 분포를 계산합니다.

    @@ -238,7 +238,7 @@

    Create pipeline parallel model

    -

    Devices for each GPU

    +

    각 GPU에 대한 디바이스입니다

    @@ -250,7 +250,7 @@

    Create pipeline parallel model

    -

    Create Fairscale Pipe module

    +

    Fairscale 파이프 모듈을 생성합니다

    @@ -277,7 +277,7 @@

    Create pipeline parallel model

    -

    Tiny Shakespeare dataset

    +

    작은 셰익스피어 데이터셋

    @@ -316,7 +316,7 @@

    Tiny Shakespeare dataset

    -

    Create experiment

    +

    실험을 생성합니다.

    @@ -329,7 +329,7 @@

    Tiny Shakespeare dataset

    -

    Initialize configs

    +

    설정값을 초기화합니다.

    @@ -348,7 +348,7 @@

    Tiny Shakespeare dataset

    -

    Start the experiment

    +

    실험을 시작합니다

    @@ -360,7 +360,7 @@

    Tiny Shakespeare dataset

    -

    Initialize the model. Do this before the loop for cleaner logs.

    +

    모델을 초기화합니다. 더 깨끗한 로그관리를 위해 루프를 돌기 전에 이 코드를 실행합니다.

    @@ -372,7 +372,7 @@

    Tiny Shakespeare dataset

    -

    Train

    +

    훈련을 시작합니다.

    diff --git a/docs/ko/neox/samples/generate.html b/docs/ko/neox/samples/generate.html index 76ccbb5..a2bbda3 100644 --- a/docs/ko/neox/samples/generate.html +++ b/docs/ko/neox/samples/generate.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - Generate Text with GPT-NeoX + GPT-NeoX로 글 생성하기 @@ -62,7 +62,7 @@

    - View code on Github + 깃헙에서 코드 보기

    @@ -71,9 +71,9 @@ -

    Generate Text with GPT-NeoX

    -

    This shows how to generate text from GPT-NeoX with a single GPU.

    -

    This needs a GPU with more than 45GB memory.

    +

    GPT-NeoX로 글 생성하기

    +

    GPT-NeoX를 한 개의 GPU를 사용해서 글을 생성하는 방법에 대한 글입니다.

    +

    45GB 이상의 메모리를 가진 GPU가 필요합니다.

    @@ -85,7 +85,7 @@

    Generate Text with GPT-NeoX

    -

    Imports

    +

    다음을 불러옵니다.

    @@ -105,8 +105,8 @@

    Generate Text with GPT-NeoX

    -

    List of layers to load. This is used for testing. You can assign a subset of layers like {0, 1} - so that it only loads the first to transformer layers.

    +

    불러오기 위한 레이어 목록입니다. 이는 테스트를 위해 사용됩니다. You can assign a subset of layers like {0, 1} + 따라서 트렌스포머 레이어의 첫번째 만 불러옵니다. so that it only loads the first to transformer layers.

    @@ -118,7 +118,7 @@

    Generate Text with GPT-NeoX

    -

    Prompt to complete

    +

    완성하기 위한 프롬프트 입니다.

    @@ -130,13 +130,13 @@

    Generate Text with GPT-NeoX

    -

    Predict the next token

    +

    다음 토큰 예상하기

    + 은 모델의 디바이스 입니다.
    @@ -159,7 +159,7 @@

    Predict the next token

    -

    Get the tokens

    +

    토큰을 구합니다

    @@ -171,7 +171,7 @@

    Predict the next token

    -

    Eval model

    +

    모델을 평가합니다

    @@ -183,7 +183,7 @@

    Predict the next token

    -

    Return predicted token

    +

    예측한 토큰을 반환합니다.

    @@ -195,7 +195,7 @@

    Predict the next token

    -

    Generate text

    +

    글 생성하기

    @@ -207,7 +207,7 @@

    Generate text

    -

    Setup cache to cache intermediate key/value pairs for faster generation

    +

    더 빠른 생성을 위해 중간단계의 키/값 pair를 cahce 하는 캐시를 설정합니다.

    @@ -220,7 +220,7 @@

    Generate text

    -

    Device

    +

    디바이스를 설정합니다

    @@ -232,7 +232,7 @@

    Generate text

    -

    Load layers

    +

    레이어를 불러옵니다

    @@ -250,7 +250,7 @@

    Generate text

    -

    Get token ids

    +

    토큰 인덱스를 구합니다.

    @@ -262,7 +262,7 @@

    Generate text

    -

    Run the model

    +

    모델을 실행합니다.

    @@ -276,7 +276,7 @@

    Generate text

    -

    Append the predicted token

    +

    예측된 토큰을 추가합니다.

    @@ -288,7 +288,7 @@

    Generate text

    -

    Predict 100 tokens

    +

    100개의 토큰을 예측합니다

    @@ -300,7 +300,7 @@

    Generate text

    -

    Set the state to use cached activations

    +

    캐시된 활성화 함수를 사용하기 위해 상태를 설정합니다.

    @@ -312,7 +312,7 @@

    Generate text

    -

    Get next token. Note that we only feed the last token to the model because we cache the key/value pairs of previous tokens.

    +

    다음 토큰을 구합니다. 마지막 토큰만 모델에게 주는 것을 잊지 마세요. 그 이유는 그 전의 키/값 페어를 임시로 복사(cache 캐시)하기 때문입니다.

    @@ -325,7 +325,7 @@

    Generate text

    -

    Append the predicted token

    +

    예측된 토큰을 추가합니다.

    @@ -337,7 +337,7 @@

    Generate text

    -

    Print

    +

    토큰을 출력합니다.

    diff --git a/docs/ko/neox/samples/index.html b/docs/ko/neox/samples/index.html index 6f0448f..5a1e4c9 100644 --- a/docs/ko/neox/samples/index.html +++ b/docs/ko/neox/samples/index.html @@ -1,14 +1,14 @@ - + - + - + @@ -18,7 +18,7 @@ - + Samples @@ -72,8 +72,8 @@ #

    Samples

    - +
    diff --git a/docs/ko/neox/samples/llm_int8.html b/docs/ko/neox/samples/llm_int8.html index 5091bc2..d5a344b 100644 --- a/docs/ko/neox/samples/llm_int8.html +++ b/docs/ko/neox/samples/llm_int8.html @@ -3,24 +3,24 @@ - + - - + + - + - + - - + + - Generate Text with GPT-NeoX using LLM.int8() quantization + LLM.int8() 양자화를 이용한 GPT-NeoX로 글 생성하기 @@ -62,7 +62,7 @@

    - View code on Github + 깃헙에서 코드보기

    @@ -71,9 +71,9 @@ -

    Generate Text with GPT-NeoX using LLM.int8() quantization

    -

    This shows how to generate text from GPT-NeoX using LLM.int8() quantization.

    -

    This needs a GPU with 24GB memory.

    +

    LLM.int8() 양자화를 이용한 GPT-NeoX로 글 생성하기

    +

    LLM.int8() 양자화를 사용하여 GPT-NeoX에서 글을 생성하는 방법을 보여줍니다.

    +

    24GB 메모리가 있는 GPU가 필요합니다.

    @@ -92,7 +92,7 @@

    Generate Text with GPT-NeoX using LLM.int8() quantization

    -

    Generate text

    +

    글 생성하기

    @@ -104,7 +104,7 @@

    Generate text

    -

    Setup cache to cache intermediate key/value pairs for faster generation

    +

    캐시 를 설정하여 중간 단계의 키/값 쌍을 캐시하여 보다 빠른 생성을 가능하게 합니다.

    @@ -117,7 +117,7 @@

    Generate text

    -

    Device

    +

    디바이스를 설정합니다

    @@ -129,7 +129,7 @@

    Generate text

    -

    Load layers in float16 into CPU. We convert the layers to int8 later, because doing that on the fly after loading layers to GPU causes CUDA memory fragmentation (about 3GB memory can get lost due to fragmentation).

    +

    float 16의 레이어를 CPU에 불러오기 합니다. 추후에 레이어를 int8로 변환합니다. 이렇게 하는 이유는 GPU에 레이어를 불러온 후 즉시 이를 수행하면 CUDA 메모리 조각화(약 3GB 메모리가 조각화로 인해 손실될 수 있음)가 발생하기 때문입니다.

    @@ -146,7 +146,7 @@

    Generate text

    -

    This reduces CUDA memory fragmentation

    +

    이를 통해 CUDA 메모리 조각화를 줄일 수 있습니다.

    @@ -164,8 +164,8 @@

    Generate text

    -

    Create nn.Sequential - model

    +

    nn.Sequential + 모델을 생성합니다

    @@ -177,7 +177,7 @@

    Generate text

    -

    Clear cache and print memory summary for debugging

    +

    디버깅을 위해 캐시를 삭제하고 메모리 요약을 출력합니다.

    @@ -190,7 +190,7 @@

    Generate text

    -

    Get token ids

    +

    토큰 인덱스를 가져옵니다.

    @@ -202,9 +202,9 @@

    Generate text

    -

    Run the model. We use the infer - function defined in generate.py -

    +

    모델을 실행합니다. generate.py + 에 정의된 infer + 함수를 사용합니다.

    @@ -218,7 +218,7 @@

    Generate text

    -

    Append the predicted token

    +

    예측된 토큰을 추가합니다.

    @@ -230,7 +230,7 @@

    Generate text

    -

    Predict 100 tokens

    +

    100개 토큰을 예측합니다.

    @@ -242,7 +242,7 @@

    Generate text

    -

    Set the state to use cached activations

    +

    캐시된 활성화 함수를 사용하기 위해 상태를 설정합니다.

    @@ -254,7 +254,7 @@

    Generate text

    -

    Get next token. Note that we only feed the last token to the model because we cache the key/value pairs of previous tokens.

    +

    다음 토큰을 가져옵니다. 이전 토큰의 키/값 쌍을 캐시하기 때문에 모델에 마지막 토큰만 제공합니다.

    @@ -267,7 +267,7 @@

    Generate text

    -

    Append the predicted token

    +

    예측된 토큰을 추가합니다.

    @@ -279,7 +279,7 @@

    Generate text

    -

    Print

    +

    토큰을 출력합니다.

    diff --git a/docs/ko/neox/utils/cache.html b/docs/ko/neox/utils/cache.html index 3f267be..b6ef224 100644 --- a/docs/ko/neox/utils/cache.html +++ b/docs/ko/neox/utils/cache.html @@ -1,26 +1,26 @@ - + - + - - + + - + - + - - + + - Cache for Intermediate Activations + 중간 활성화를 위한 캐시 @@ -62,7 +62,7 @@

    - View code on Github + 깃헙에서 코드보기

    @@ -71,8 +71,8 @@ -

    Cache for Intermediate Activations

    -

    During inference the model outputs token by token. We use this simple cache to store key's and value's attention layers, so that we don't have to recompute them for previous tokens.

    +

    중간 활성화를 위한 캐시

    +

    추론하는 동안 모델은 토큰별로 토큰을 출력합니다. 이 간단한 캐시를 사용하여 키 및 값의 어텐션 레이어를 저장하므로 이전 토큰에 대해 다시 계산할 필요가 없습니다.

    @@ -84,8 +84,8 @@

    Cache for Intermediate Activations

    -

    Cache

    -

    This maintains a key-value cache and queues push values and pop them in the same order. The queues are useful since we have multiple attention layers.

    +

    캐시

    +

    이는 키-값 캐시를 유지하고 추가(push) 값이 대기열에 추가되고 동일한 순서로 삭제(pop)됩니다. 이는 여러 어텐션 레이어가 있기 때문에 유용합니다.

    @@ -109,7 +109,7 @@

    Cache

    -

    Clear cache

    +

    캐시 지우기

    @@ -132,11 +132,11 @@

    Clear cache

    -

    Push a value to a queue

    +

    값을 큐(queue)에 추가하기

    + 은 추가될 값입니다.
    @@ -148,7 +148,7 @@

    Push a value to a queue

    -

    Create an empty queue if it's not present

    +

    큐(queue)가 없으면 빈 큐를 생성합니다.

    @@ -161,7 +161,7 @@

    Push a value to a queue

    -

    Push to the queue

    +

    값을 큐에 추가합니다.

    @@ -173,10 +173,10 @@

    Push a value to a queue

    -

    Return the size of the queue

    +

    큐 크기 반환하기

    + 은 큐의 이름입니다. +

    이름이 존재하면 큐의 크기를 이름이 존재하지 않으면 None을 반환합니다.

    @@ -205,10 +205,10 @@

    Return the size of the queue

    -

    Pop from a queue

    +

    큐에서 값 꺼내기

    + 은 큐의 이름입니다. +

    값을 반환합니다

    @@ -231,11 +231,11 @@

    Pop from a queue

    -

    Cache a value

    +

    값을 캐시하기

    + 는 값입니다.
    @@ -258,12 +258,12 @@

    Cache a value

    -

    Retrieve a value from cache

    +

    캐시에서 값 검색하기

    + 는 캐시가 비어있는 경우 사용됩니다. +

    캐시된 값을 반환합니다

    @@ -286,9 +286,9 @@

    Retrieve a value from cache

    -

    Clear a cache value

    +

    캐시 값 지우기

    + 는 캐시할 때 사용하는 이름입니다
    @@ -311,7 +311,7 @@

    Clear a cache value

    -

    Singleton for cache

    +

    캐시를 위한 싱글톤(Singleton)패턴 입니다

    @@ -323,8 +323,8 @@

    Clear a cache value

    -

    Get the cache instance

    - +

    캐시 인스턴스를 가져오기

    +
    diff --git a/docs/ko/normalization/batch_norm/index.html b/docs/ko/normalization/batch_norm/index.html index b5f0c2b..a774ed9 100644 --- a/docs/ko/normalization/batch_norm/index.html +++ b/docs/ko/normalization/batch_norm/index.html @@ -74,36 +74,36 @@

    배치 정규화

    -

    이것은 배치 정규화에 대한 Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift 논문의 파이토치 구현체입니다.

    -

    내부 공변량 변화

    -

    본 논문은 내부 공변량 변화 를 학습 도중 네트워크 매개변수들의 변화로 인한 네트워크 활성화함수들의 분포 변화라고 정의합니다. 예를 들어, 두 가지 레이어가 있다고 생각해봅시다. 학습 초기에는 의 출력 (의 입력)의 분포가 정규분포 를 따를 수 있습니다. 그리고, 몇 차례의 학습 스텝 이후에는 분포가 정규분포 를 따르는 방향으로 움직일 수 있습니다. 이것을 내부 공변량 변화라고 부릅니다.

    -

    내부 공변량 변화는 이후 레이어 (위의 예시상으로는 )가 이동된 분포에 맞춰가야 하기 때문에 학습 속도에 안 좋은 영향을 미칠 것입니다.

    -

    분포를 안정화시킴에 따라, 배치 정규화는 내부 공변량 변화를 최소화하게 됩니다.

    -

    정규화

    -

    whitening은 학습 속도와 수렴을 빠르게 도와준다고 알려져 있습니다. Whitening은 입력의 평균을 0, 그리고 공분산을 단위행렬로 갖는 정규분포 형태로 선형 변환하는 것을 말한다.

    -

    그래디언트 연산 밖에서 정규화를 하는 것은 효과를 주지 않는다

    -

    사전에 계산된 평균과 분산을 활용하여 그래디언트 연산 밖에서 정규화하는 것은 효과가 없다. 예를 들어, (분산을 무시한다고 가정하고), 이고 는 학습된 편향이며 는 사전에 계산된 상수인 그래디언트 연산 밖의 값일때 라고 가정하자.

    -

    에 관하여 아무런 영향이 없다는 점을 명심해야 한다. 그러므로, 에 기반하여 매 학습 업데이트 주기마다 무기한적으로 증가하거나 감소할 것이다. 본 논문은 동일한 폭발적 증감 현상이 분산에 관해서도 발생하는 점을 명시하였다.

    -

    배치 정규화

    -

    Whitening은 상관관계를 줄여야 하는 과정이고 그래드인터 값이 whitening 연산 전체에 흘러 들어가야 하기 때문에 연산적으로 비용이 많이 든다.

    -

    본 논문은 배치 정규화라고 부르는 간소화된 버전을 소개한다. 첫번째로 간소화된 점은 각각의 특징을 평균이 0이고 분산이 1이 되도록 독립적으로 정규화를 한다는 점이다: 차원 입력이다.

    -

    두 번째로 간소화된 점은 정규화를 하기 위해 전체 데이터셋으로부터 평균과 분산 값을 계산하는 대신에 미니배치로부터 평균 과 분산 의 측정값을 사용한다는 점이다.

    -

    각각의 특징이 평균이 0이고 분산이 1이 되도록 정규화를 하는 것은 레이어가 표현하고자 하는 것에 영향을 줄 수 있다. 예시 논문이 묘사하듯이, 만약에 시그모이드 함수의 입력이 정규화된 경우 대부분의 값은 시그모이드 함수가 선형인 범위에 있을 것이다. 이것을 극복하기 위해 각가의 특징은 두 개의 학습 매개변수 에 의하여 확대되고 이동되어진다. 는 배치 정규화 레이어의 출력이다.

    -

    와 같은 선형 변환 이후에 배치 정규화를 적용하는 경우 편향 매개변수 는 정규화에 의해 값의 의미가 사라진다. 따라서 배치 정규화 바로 직전의 선형 변환에서 편향 매개변수를 제외해야 한다.

    -

    또한 배치 정규화는 역전파 값을 가중치의 크기 정도에 변함없도록 만들어주고 경험적으로 일반화 효과도 가지고 있음을 알 수 있다.

    -

    추론

    -

    우리는 정규화를 수행하기 위해 를 알아야 한다. 따라서 추론 시에는 평균과 분산 값을 찾기 위해 데이터셋의 전체 혹은 일부분을 살펴보거나 학습 도중 계산된 측정값을 사용할 수도 있다. 주로 사용되는 방법은 추론 시에 학습 단계에서 지수 이동 평균으로 계산된 평균과 분산 값을 사용하는 것이다.

    -

    여기에 MNIST 데이터셋에 대하여 CNN 분류기를 학습하는데 배치 정규화를 사용한 학습 코드 와 노트북이 있다.

    +

    배치 정규화에 대한 Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift 논문의 파이토치 구현입니다.

    +

    내부 공변량 변화

    +

    본 논문은 내부 공변량 변화 를 학습 도중 네트워크 매개변수들의 변화로 인한 네트워크 활성화함수들의 분포 변화라고 정의합니다. 예를 들어, 두 가지 레이어가 있다고 생각해봅시다. 학습 초기에는 의 출력 (의 입력)의 분포가 정규분포 를 따를 수 있습니다. 그리고, 몇 차례의 학습 스텝 이후에는 분포가 정규분포 를 따르는 방향으로 움직일 수 있습니다. 이것을 내부 공변량 변화라고 부릅니다.

    +

    내부 공변량 변화는 이후 레이어 (위의 예시상으로는 )가 이동된 분포에 맞춰가야 하기 때문에 학습 속도에 안 좋은 영향을 미칠 것입니다.

    +

    분포를 안정화시킴에 따라, 배치 정규화는 내부 공변량 변화를 최소화하게 됩니다.

    +

    정규화

    +

    Whitening은 학습 속도와 수렴을 빠르게 도와준다고 알려져 있습니다. Whitening은 입력의 평균을 0, 그리고 공분산을 단위행렬로 갖는 정규분포 형태로 선형 변환하는 것입니다.

    +

    그래디언트 연산 밖에서 정규화를 하는 것은 효과가 없습니다

    +

    사전에 계산된 평균과 분산을 활용하여 그래디언트 연산 밖에서 정규화하는 것은 효과가 없습니다. 예를 들어, (분산을 무시한다고 가정하고), 이고 는 학습된 편향이며 는 사전에 계산된 상수인 그래디언트 연산 밖의 값일때 라고 가정합니다.

    +

    에 관하여 아무런 영향이 없다는 점을 명심해야 한다. 그러므로, 에 기반하여 매 학습 업데이트 주기마다 무기한적으로 증가하거나 감소합니다. 본 논문은 동일한 폭발적 증감 현상이 분산에 관해서도 발생하는 점을 명시했습니다.

    +

    배치 정규화

    +

    Whitening은 상관관계를 줄여야 하는 과정이고 그래드인터 값이 whitening 연산 전체에 흘러 들어가야 하기 때문에 연산적으로 비용이 많이 듭니다.

    +

    본 논문은 배치 정규화라고 부르는 간소화된 버전을 소개합니다. 첫번째로 간소화된 점은 각각의 특징을 평균이 0이고 분산이 1이 되도록 독립적으로 정규화를 한다는 점입니다: 여기서 -차원의 입력값입니다.

    +

    두 번째로 간소화된 점은 정규화를 하기 위해 전체 데이터셋으로부터 평균과 분산 값을 계산하는 대신에 미니배치로부터 평균 과 분산 의 측정된 값을 사용한다는 점입니다.

    +

    각각의 특징이 평균이 0이고 분산이 1이 되도록 정규화를 하는 것은 레이어가 표현하고자 하는 것에 영향을 줄 수 있습니다. 예시 논문이 묘사하듯이, 만약에 시그모이드 함수의 입력이 정규화된 경우 대부분의 값은 시그모이드 함수가 선형인 범위에 있을 것입니다. 이를 극복하기 위해 각가의 특징은 두 개의 학습 매개변수 에 의하여 확대되고 이동합니다. 는 배치 정규화 레이어의 출력입니다.

    +

    와 같은 선형 변환 이후에 배치 정규화를 적용하는 경우 편향 매개변수 는 정규화에 의해 값의 의미가 사라집니다. 따라서 배치 정규화 바로 직전의 선형 변환에서 편향 매개변수를 제외해야 합니다.

    +

    배치 정규화는 또한 역전파를 가중치의 크기에 변함없도록 만들고 경험적으로 일반화를 향상시키므로 정규화 효과도 있습니다.

    +

    추론하기

    +

    정규화를 수행하기 위해 를 알아야 합니다. 따라서 추론 할때는 평균과 분산 값을 찾기 위해 데이터셋의 전체 혹은 일부분을 살펴보거나 학습 도중 계산된 측정값을 사용할 수도 있습니다. 주로 사용되는 방법은 학습 단계에서 지수 이동 평균으로 계산된 평균과 분산 값을 추론에 사용하는 것입니다.

    +

    여기에 MNIST 데이터셋에 대하여 배치 정규화를 사용하는 CNN 분류기를 학습하기 위한 학습 코드 와 노트가 있습니다.

    Open In Colab

    diff --git a/docs/ko/normalization/batch_norm/readme.html b/docs/ko/normalization/batch_norm/readme.html index 8516d04..e9619cf 100644 --- a/docs/ko/normalization/batch_norm/readme.html +++ b/docs/ko/normalization/batch_norm/readme.html @@ -1,5 +1,5 @@ - + @@ -7,20 +7,20 @@ - + - + - + - + - Batch Normalization + 배치 정규화 @@ -62,7 +62,7 @@

    - View code on Github + 깃헙에서 코드보기

    @@ -71,20 +71,20 @@ -

    Batch Normalization

    -

    This is a PyTorch implementation of Batch Normalization from paper Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift.

    -

    Internal Covariate Shift

    -

    The paper defines Internal Covariate Shift as the change in the distribution of network activations due to the change in network parameters during training. For example, let's say there are two layers and . During the beginning of the training outputs (inputs to ) could be in distribution . Then, after some training steps, it could move to . This is internal covariate shift.

    -

    Internal covariate shift will adversely affect training speed because the later layers ( in the above example) have to adapt to this shifted distribution.

    -

    By stabilizing the distribution, batch normalization minimizes the internal covariate shift.

    -

    Normalization

    -

    It is known that whitening improves training speed and convergence. Whitening is linearly transforming inputs to have zero mean, unit variance, and be uncorrelated.

    -

    Normalizing outside gradient computation doesn't work

    -

    Normalizing outside the gradient computation using pre-computed (detached) means and variances doesn't work. For instance. (ignoring variance), let where and is a trained bias and is an outside gradient computation (pre-computed constant).

    -

    Note that has no effect on . Therefore, will increase or decrease based , and keep on growing indefinitely in each training update. The paper notes that similar explosions happen with variances.

    -

    Batch Normalization

    -

    Whitening is computationally expensive because you need to de-correlate and the gradients must flow through the full whitening calculation.

    -

    The paper introduces a simplified version which they call Batch Normalization. First simplification is that it normalizes each feature independently to have zero mean and unit variance:

    이것은 배치 정규화에 대한 Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift 논문의 파이토치 구현입니다.

    +

    내부 공변량 변화

    +

    본 논문은 내부 공변량 변화 를 학습 도중 네트워크 매개변수들의 변화로 인한 네트워크 활성화함수들의 분포 변화라고 정의합니다. 예를 들어, 두 가지 레이어가 있다고 생각해봅시다. 학습 초기에는 의 출력 (의 입력)의 분포가 정규분포 를 따를 수 있습니다. 그리고, 몇 차례의 학습 스텝 이후에는 분포가 정규분포 를 따르는 방향으로 움직일 수 있습니다. 이것을 내부 공변량 변화라고 부릅니다.

    +

    내부 공변량 변화는 이후 레이어 (위의 예시상으로는 )가 이동된 분포에 맞춰가야 하기 때문에 학습 속도에 안 좋은 영향을 미칠 것입니다.

    +

    분포를 안정화시킴에 따라, 배치 정규화는 내부 공변량 변화를 최소화하게 됩니다.

    +

    정규화

    +

    Whitening은 학습 속도와 수렴을 빠르게 도와준다고 알려져 있습니다. Whitening은 입력의 평균을 0, 그리고 공분산을 단위행렬로 갖는 정규분포 형태로 선형 변환하는 것입니다.

    +

    그래디언트 연산 밖에서 정규화를 하는 것은 효과가 없습니다

    +

    사전에 계산된 평균과 분산을 활용하여 그래디언트 연산 밖에서 정규화하는 것은 효과가 없습니다. 예를 들어, (분산을 무시한다고 가정하고), 이고 는 학습된 편향이며 는 사전에 계산된 상수인 그래디언트 연산 밖의 값일때 라고 가정합니다.

    +

    에 관하여 아무런 영향이 없다는 점을 명심해야 한다. 그러므로, 에 기반하여 매 학습 업데이트 주기마다 무기한적으로 증가하거나 감소합니다. 본 논문은 동일한 폭발적 증감 현상이 분산에 관해서도 발생하는 점을 명시했습니다.

    +

    배치 정규화

    +

    Whitening은 상관관계를 줄여야 하는 과정이고 그래드인터 값이 whitening 연산 전체에 흘러 들어가야 하기 때문에 연산적으로 비용이 많이 듭니다.

    +

    본 논문은 배치 정규화라고 부르는 간소화된 버전을 소개합니다. 첫번째로 간소화된 점은 각각의 특징을 평균이 0이고 분산이 1이 되도록 독립적으로 정규화를 한다는 점입니다: where is the -dimensional input.

    -

    The second simplification is to use estimates of mean and variance from the mini-batch for normalization; instead of calculating the mean and variance across the whole dataset.

    -

    Normalizing each feature to zero mean and unit variance could affect what the layer can represent. As an example paper illustrates that, if the inputs to a sigmoid are normalized most of it will be within range where the sigmoid is linear. To overcome this each feature is scaled and shifted by two trained parameters and . where is the output of the batch normalization layer.

    -

    Note that when applying batch normalization after a linear transform like the bias parameter gets cancelled due to normalization. So you can and should omit bias parameter in linear transforms right before the batch normalization.

    -

    Batch normalization also makes the back propagation invariant to the scale of the weights and empirically it improves generalization, so it has regularization effects too.

    -

    Inference

    -

    We need to know and in order to perform the normalization. So during inference, you either need to go through the whole (or part of) dataset and find the mean and variance, or you can use an estimate calculated during training. The usual practice is to calculate an exponential moving average of mean and variance during the training phase and use that for inference.

    -

    Here's the training code and a notebook for training a CNN classifier that uses batch normalization for MNIST dataset.

    +M1001 80h400000v40h-400000z">x(k)E[x(k)] 여기서 -차원의 입력값입니다.

    +

    두 번째로 간소화된 점은 정규화를 하기 위해 전체 데이터셋으로부터 평균과 분산 값을 계산하는 대신에 미니배치로부터 평균 과 분산 의 측정된 값을 사용한다는 점입니다.

    +

    각각의 특징이 평균이 0이고 분산이 1이 되도록 정규화를 하는 것은 레이어가 표현하고자 하는 것에 영향을 줄 수 있습니다. 예시 논문이 묘사하듯이, 만약에 시그모이드 함수의 입력이 정규화된 경우 대부분의 값은 시그모이드 함수가 선형인 범위에 있을 것입니다. 이를 극복하기 위해 각가의 특징은 두 개의 학습 매개변수 에 의하여 확대되고 이동합니다. 는 배치 정규화 레이어의 출력입니다.

    +

    와 같은 선형 변환 이후에 배치 정규화를 적용하는 경우 편향 매개변수 는 정규화에 의해 값의 의미가 사라집니다. 따라서 배치 정규화 바로 직전의 선형 변환에서 편향 매개변수를 제외해야 합니다.

    +

    배치 정규화는 또한 역전파를 가중치의 크기에 변함없도록 만들고 경험적으로 일반화를 향상시키므로 정규화 효과도 있습니다.

    +

    추론하기

    +

    정규화를 수행하기 위해 를 알아야 합니다. 따라서 추론 할때는 평균과 분산 값을 찾기 위해 데이터셋의 전체 혹은 일부분을 살펴보거나 학습 도중 계산된 측정값을 사용할 수도 있습니다. 주로 사용되는 방법은 학습 단계에서 지수 이동 평균으로 계산된 평균과 분산 값을 추론에 사용하는 것입니다.

    +

    여기에 MNIST 데이터셋에 대하여 배치 정규화를 사용하는 CNN 분류기를 학습하기 위한 학습 코드 와 노트가 있습니다.

    Open In Colab