본문 바로가기

분류 전체보기

(111)
encoder-decoder (seq2seq) input sequence, output sequence의 토큰 개수가 다를 경우에 대한 대응 , 토큰을 둔다. encoder을 활용하여 input sequence에 대한 정보를 은닉층에 집약한다. 집약한 은닉층을 토큰과 함께 디코더의 첫 입력에 입력한다. input sequence 전체를 은닉층에 넣어서 정보 손실이 발생하며, 어텐션 메커니즘 등장의 계기가 되었다.
Tokenizer은 어떻게 만들어졌는가? BPE. Byte-pair encoding. 글자 두개가 중복되면 다른 글자로 치환해주고, 이를 반복하는 것. Word-piece BPE 방식을 활용함. 우선 띄어쓰기 기준으로 단어로 분리하고 (그래서 word-piece) 각 단어를 Byte-pair encoding을 진행함. 그리고 이를 통해 만들어진 토큰 집합을 벡터 변경시 활용한다. Sentence-piece Word-piece와 다른 점은 띄어쓰기 기준으로 분리하지 않는다는 것. 그래서 띄어쓰기를 쓰지 않거나 띄어쓰기가 다른 용도로 활용되는 언어에 좋음.
huggingface의 AutoModel 클래스 from transformers import AutoModel checkpoint = "distilbert-base-uncased-finetuned-sst-2-english" model = AutoModel.from_pretrained(checkpoint) This architecture contains only the base Transformer module: given some inputs, it outputs what we’ll call hidden states, also known as features. For each model input, we’ll retrieve a high-dimensional vector representing the contextual understanding of ..
GraphCodeBERT 메모 sequence input X = {[CLS], W, [SEP], C, [SEP], V } source code C = {c1, c2, ..., cn} comment W = {w1, w2, ..., wm} where V = {v1, v2, ..., vk} is a set of variables E = {ε1, ε2, ..., εl} is a set of direct edges that represent where the value of each variable comes from. We use a special position embedding for all variables to indicate that they are nodes of data flow.
훈련하면 훈련한거지 사전훈련은 또 뭔데 What is pretraining? - This pretraining is usually done on very large amounts of data. Therefore, it requires a very large corpus of data, and training can take up to several weeks. What is fine-tuning? - Fine-tuning, on the other hand, is the training done after a model has been pretrained. To perform fine-tuning, you first acquire a pretrained language model, then perform additional training w..
핸즈온 머신러닝 Ch 10 연습문제 3. 고전적인 퍼셉트론과 로지스틱 회귀 분류기를 비교했을 때, 로지스틱 회귀 분류기가 선호되는 이유 - 로지스틱 회귀 분류기는 클래스 확률을 제공함. 반면, 고전적인 퍼셉트론은 정해진 임곗값을 기준으로 분류하여 확률 제공 불가 4. 왜 초창기의 다층 퍼셉트론을 훈련할 때 로지스틱 활성화 함수가 핵심 요소였는가? - 손실 최적화를 위한 경사하강 시 미분이 가능해야 했는데, 계단 함수로는 미분이 불가능했기 때문에. 5. 인기 많은 활성화함수 3가지 - Sigmoid, ReLU, LeakyReLU 6. 입력층 (통과 뉴런 10개), 은닉층 (뉴런 50개), 출력층 (뉴런 3개), 활성화 함수 ReLU의 경우 - 입력 행렬 X의 크기는? m * 10, m은 배치 크기 - 은닉층 가중치 행렬 W_h와 편향 벡터 ..
딥러닝 관련 의문 softmax를 활용하는 이유: 그냥 총합에서 출력값의 비율을 활용하면 안되나? 출력값을 확률화하는 활성화 함수이므로, 통계와 관련이 있어보인다. 또, 생각해보니 얘는 activation function임에도 불구하고 가중치를 1로 요구하는 것 아닌가? activation function이 맞긴 한가?
딥러닝의 주요 개념 1. Perceptron 현재 Neural network의 최소 구성요소인 neruon, 혹은 unit의 전신이라 볼 수 있다. Activation function으로 계단 함수를 활용한다. 선형 문제를 해결한다. 2. Multi-layer perceptron 하나의 Perceptron은 비선형 문제를 풀 수 없다(예: XOR). 그러나 perceptron을 multi-layer로 구성했을 때 비선형 문제를 해결할 수 있다. 3. Sigmoid (Activation function) 계단함수를 사용하면 가중치가 변경되어도 일정량을 초과하지 않는다면 출력값에 변화를 주지 못한다. Sigmoid activation function은 이러한 문제를 해결하여 경사법을 가능케 하였다. 4. Loss 앞의 Sigm..