Coursera 22

[Coursera] DLS_C5W4: Transformer

*사담: 개인적으로 정리한 Transformer paper는 여기에서 확인할 수 있다. Coursera 강의에서는 이전에 알고 있던 방식과 다른 시각에서 해석을 해준다. 1. Transformers Motivation : RNN, GRU, LSTM 같은 모델은 한 번에 한 단어씩 sequential 하게 단어를 processing 한다. 따라서, 마지막 block의 output (마지막 단어)를 계산하기 위해서는 이전 blcok의 output도 모두 계산되어야 한다. 하지만 transformer를 활용하면 전체 sequence에 대해 병렬로 processing 할 수 있다. 2. Transformer Intuition Transformer는 Attention과 CNN-style processing (병렬..

ML || DL/이론 2023.10.19

[Coursera] DLS_C5W3: Sequence to Sequence Model / Beam Search / Attention Model

1. Basic model Sequence to Sequence model : Encoder-Decoder 구조 Image captioning 2. Picking the most likely sentence Language model과 machine translation model과의 차이점: language model은 output을 random 하게 sampling 하지만, machine translation model은 입력이 주어졌을 때 가장 확률이 높은 output을 sampling 한다. --> Machin translation as building a conditional language model 하지만, 우리는 vocabulary에 있는 모든 단어에 대한 확률을 구한 다음에 가장 높은 확..

ML || DL/이론 2023.10.18

[Coursera] DLS_C5W2: Sentiment Classification / Debiasing Word Embeddings

1. Sentiment classification : 입력 text가 긍정적인지? 부정적인지? 혹은 별점이 어느 정도 되는지 예측하는 task 이러한 sentiment classification 문제의 challenge 중 하나는 큰 규모의 labeled dataset이 없다는 것이다. 하지만, 더 큰 규모의 text corpus로 학습된 word embeddings를 활용하면, 작은 규모의 labeled dataset만 있어도 괜찮은 성능을 낼 수 있다. (labeled train set에서 보게 되는 새로운 단어에 대해서도 일반화 잘 수행) 먼저, word embeddings를 활용한 simple sentiment classification model의 예를 보면 아래 그림과 같다. 하지만 위와 같은..

ML || DL/이론 2023.10.17

[Coursera] DLS_C5W2: Learning Word Embeddings (Word2Vec / GloVe)

1. Learning word embeddings Word embeddings를 학습할 수 있는 몇 가지 알고리즘들을 소개한다. 먼저, language model을 구축하는 것은 embeddings를 학습하는 방법이 될 수 있다. 2. Word2Vec : 이러한 embeddings를 학습할 수 있는 simpler & more efficient 한 방법은 바로 Word2Vec이다. Word2Vec paper에서는 Continuous Bag Of Word (CBOW)와 Skip-grams 모델 두 가지가 존재하는데, 해당 강의에서는 skip-grams에 대해서만 다룬다. - Skip-grams: context word를 randomly pick 해서 (uniformly random은 아님), 특정 size의..

ML || DL/이론 2023.10.16

[Coursera] DLS_C5W2: Introduction to Word Embeddings

1. Word representation (Word embeddings) : 지금까지 우리는 trainset에서 본 단어들을 vocabulary에 저장하고, 각 word들을 one-hot vector로 representation을 했다. 하지만 one-hot vector로 representation할 경우 아래 그림과 같은 문제점이 발생한다. 따라서, 우리는 featurized representation (word embedding)을 활용해야한다. 이러한 word embeddings를 visualization하면 아래 그림과 같이 유사한 단어들끼리 모여있게 된다. 2. Using word embeddings : 이러한 word embedding를 활용해보자. 쉬운 이해를 위해, named entity ..

ML || DL/이론 2023.10.16

[Coursera] DLS_C5W1: GRU / LSTM / BRNN / DeepRNN

basic RNN에는 두 가지 단점이 존재한다. 1. Long-range dependencies가 있는 경우, 이에 대응하기 어렵다 2. Gradient vanishing problem 1. Gated Recurrent Unit (GRU) GRU를 활용하면 long-range connection을 더 잘 포착할 수 있고, vanishing gradient 문제를 많이 해결할 수 있다. GRU는 update gate를 활용해서, 많은 time step이 지나서도 기억해야 하는 정보들을 기억하게 할 수 있다. 위의 그림은 GRU의 이해를 돕기 위해 그려졌고, 사실 $\tilde{C}^{\langle t \rangle}$의 식은 아래와 같다. 2. Long Short Term Memory (LSTM) : GR..

ML || DL/이론 2023.10.13

[Coursera] DLS_C5W1: Recurrent Neural Networks (RNN)

Course 5에서는 sequence model에 대해서 다룬다. 1. Examples of sequence data Speech recognition: 음성을 입력으로 받아 텍스트로 반환 (x=audio clip, y=text transcript) Music generation: empty set이나 특정 integer(음악의 장르)를 입력으로 받아, 음악을 생성 (x=empty set or single integer, y=music) Sentiment classification: 어떤 문장을 받아서, 그 문장의 감정이 어떤 감정인지 분류 (x=text, y=0/1 or 리뷰 평점(1~5)) Machine translation: 특정 언어로 작성된 텍스트를 다른 언어로 번역 (x=프랑스어로 된 문장, ..

ML || DL/이론 2023.10.11

[Coursera] DLS_C4W4: Neural Style Transfer

1. Neural style transfer (NST) 란? Content image (C)의 content (e.g., 전반적인 structure)를 살리면서 style image (S)의 style (e.g., 특정 화가의 화풍)을 가지는 이미지를 generate 하는 것 이러한 NST를 구현하기 위해서는 NN의 shallow and deep layer에서 추출된 feature들의 특징을 먼저 알아야 한다. What are deep ConvNets learning? NN의 각 layers들을 visualization 했을 때의 결과는 아래 그림과 같다. 그림을 보면 shallow layer에서는 low-level feature (e.g., edges)를 detect 하고, layer가 깊어질수록 hi..

ML || DL/이론 2023.10.10

[Coursera] DLS_C4W4: Face Recognition

1. Face verification과 face recognition Verification (Input image가 어떤 사람인지 아닌지 판별) Input: 사람의 face image Output: input image가 claimed person인지 아닌지 판별 Recognition (Input image를 database와 비교해서 어떤 사람인지 혹은 database에 없는 사람인지 판별) K명의 사람에 대한 database가 존재 Input: 사람의 face image Output: input image가 database내에 있는 K명의 사람 중 한 명인지, 아니면 "not recognized (database에 없는 사람)"인지 판별 Recognition이 Verification보다 매우 까다로..

ML || DL/이론 2023.10.09

[Coursera] DLS_C4W3: Semantic Segmentation

Semantic segmentation은 정교한 윤곽선을 그려서 object에 속하는 pixel과 그렇지 않은 pixel을 구분하는 것이다. 즉, 이미지 내의 모든 픽셀에 대해 labeling을 수행한다고 생각하면 된다. 이미지 내의 모든 pixel에 대해 적절한 class를 예측해서 segmantation map을 도출해야 한다. 이러한 semantic segmentation을 수행하기 위해서 U-Net architecture를 활용하는데, 이를 이해하기 위해서는 Transpose Convolution을 알아야 한다. 1. Transpose Conovlution Normal convolution의 경우, 입력 이미지를 scale-down 시킨다. 즉 이미지에서 중요한 feature 정보를 압축한다. 하..

ML || DL/이론 2023.10.08