Softmax Function
class 의 경우에서 generalized linear model (reference)
- : 가 클래스 에 속할 확률을 모델링
- Bayes theorem 에 의해서 유도됨
B) Log-sum-exp Trick (lse function)
일반적으로
1 min read
class K>2 의 경우에서 generalized linear model (reference)
p(Ck∣x)=∑jp(x∣Cj)p(Cj)p(x∣Ck)p(Ck)=∑jexp(aj)exp(ak)일반적으로 m=maxcac
...ttention 이 있다. 두 함수의 차이점은 compatibility function 으로 한개의 hidden layer 가 있는 MLP 를 사용하는가 (additive) 아니면, softmax function 을 사용하는가 (multiplicative) 의 차이점이 있다. dot product 가 더 계산은 빠르지만, key 의 차원 d k 가 커질수록 additive 방식이 좋은 성능을...
... 수 있습니다. context 에 있는 단어들을 one hot vector 로 표현한 후, 이를 embedding vector 로 변환하여 하나로 쌓습니다 (stack). 그런 다음 softmax function layer 를 통해 확률 벡터를 출력합니다. 이 확률 벡터는 corpus 내 고유 단어 개수인 n 차원의 벡터이며, 각 단어가 context 에 기반해 선택될 확률을 나타냅니다. 마...
GPT 2 Let’s reproduce GPT 2 (124M) YouTube B) Questions dropout 은 왜 softmax 이후에 적용하는 걸까? GPT 모델에서 cheating 방지를 위해 masking 하는 방식은 아직도 이해를 잘 못하겠음. C) Related D) References
Hierarchical Softmax Hierarchical Softmax 는 softmax function 를 전체로 계산하기 보다는 Tree 구조로 Hierarchical 하게 Softmax 를 계산하는 방법이다. B) Related skip gram C) References
...이다. 양의 logit 값이면, 이에 해당하는 확률은 0.5 보다 높은 것이다. C) Machine Learning 에서 사용처 주로 logit 은 Normalization 을 위해 softmax function 의 입력값으로 사용된다. D) Related E) References
Negative Sampling Negative Sampling 은 skip gram 모델의 softmax 함수 계산 비용을 절약하기 위해 고안된 Word Embedding 방식이다. 기존에는 context word 를 입력받고, target word 에 대한 multi classficiatio...
... 은 tanh function 또는 ReLU function 그리고 y^{<t>} 에서 사용하는 activation function 은 sigmoid function 또는 softmax function A.2.1) RNN forward 식의 Simplification a^{<t>}=g\left(W {aa}a^{<t>}+W {ax}x^{<t>}+b {...
...명할 수 있는 시퀀스 내 또 다른 토큰을 찾는다. 물론 자기 자신에 대한 내적값도 계산한다 (e.g. q^{<3>} \cdot k^{<3>}). 이후 내적값 (정확히는 softmax 값) 에 토큰 별 value vector v 를 곱한 뒤 모두 더하면, 해당 벡터가 attention value 를 표현하는 vector 가 된다. 각 토큰의 attention vector...