본문 바로가기

자연어 처리 과정

(62)
What is Learning Rate Warmup? 개요 Mini-batch SGD를 사용했을 때, Learning에 도움을 주었다고 하는 Learning rate warmup이 무엇인지 알아보자. 1. Learning rate warmup? 2. Learning rate warmup의 용법 3. 마무리 Learning rate warmup? Learning rate warmup이 왜 필요한가? Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour라는 논문에서 제시된 학습 방법 중 하나이다. 위의 논문을 작성한 연구진은 minibatch 학습을 할 때, Learning rate를 scaling하는 것에 있어서 효과적인 rule를 발견했다고 한다. 그 rule의 이름은 Linear Scaling Rule로..
Learning Rate Schedulers(PyTorch) https://dacon.io/codeshare/2373 다양한 Learning Rate Scheduler(pytorch) 월간 데이콘 제 2회 컴퓨터 비전 학습 경진대회 dacon.io
torch.gather https://pajamacoder.tistory.com/2 [pytorch] torch.gather 설명 pytorch 코드를 분석하다 torch.gather() 메서드의 동작이 헷갈려 정리해 본다. torch.gather() 메서드는 input tensor로 부터 원하는 차원에서 주어진 index에 해당하는 원소만을 골라 새로운 텐서를 만들때 사 pajamacoder.tistory.com
Confusion matrix 개요 모델 성능 Metrics 중 하나인 Confusion matrix에 대해 알아보자. 1. Confusion matrix 2. Confusion matrix의 경우의 수 3. Confusion matrix에서 구할 수 있는 성능 수식 4. 마무리 Confusion matrix Confusion matrix의 경우의 수 우선, Confusion matrix에는 네 가지 경우가 존재한다. TP: Label이 true인데, true라고 예측했을 때 FN: Label이 true인데, false라고 예측했을 때 TN: Label이 false인데, false라고 예측했을 때 FP: Label이 false인데, true라고 예측했을 때 쉽게 나만의 방식대로 표현하자면, 앞의 T/F는 예측과 label이 같은지 같..
pytorch의 manual_seed https://rabo0313.tistory.com/entry/pytorch-torchmanualseed [Pytorch] torch.manual_seed() random seed 란 ? numpy 에서도 사용했던 random seed 5개의 난수를 생성 한다고 하면 우리는 np.random.rand(5)로 난수를 생성한다. 연달아서 np.random.rand(5)를 실행한다면 아래처럼, 생성할때마다 매번 서로 다 rabo0313.tistory.com numpy에서 seed 역할을 하는 것이 torch의 manual_seed
What's the role of "pooler" in BERT? https://github.com/google-research/bert/issues/1102
BERT 개요 1. Transformer의 등장 그 이후 2. Unidirectional model의 한계와 pre-training 모델 3. BERT의 등장 4. BERT의 동작 과정 5. Pre-training BERT 6. 마무리 Transformer 등장 그 이후 Transformer라는 모델이 등장하고 나서 자연어 처리는 눈에 띄는 성능 향상을 이끌어낼 수 있었다. 기존의 Seq2seq with attention 모델의 RNN 구조를 완전히 제거한 것이 좋은 효과를 보였던 것이다. 더불어, seq2seq with attention 모델과는 달리 encoder와 decoder에 self-attention을 적용해줌으로써 더 좋은 성능을 보일 수 있게 됐다. 그렇게 Transformer를 기반으로 한, tr..
Transformer - overview 개요 1. Seq2seq의 한계 2. Self-attention 3. Transformer의 탄생과 동작 과정 전 알아야 할 것 4. Transformer의 동작 과정 5. 마무리 Seq2seq의 한계 저번 글에서 다뤘던 것처럼 seq2seq는 Encoder-Decoder 구조를 가지고 있어서 RNN을 사용하여 번역 task를 처리할 수 있도록 도와준 구조이다. 그러나 제한된 차원을 가진 Context vector안에 encoder의 input sequence를 함축시켜야 한다는 문제점이 있었다. 그런 과정에 정보의 유실이 발생하는 건 크게 놀랍지 않은 일일 것이다. 이러한 seq2seq의 문제점을 attention mechanism으로 해소를 해낸 것이 seq2seq with attention이었다. ..
What's the meaning of "Shifted right" in Transformer? https://datascience.stackexchange.com/a/88983 What are the inputs to the first decoder layer in a Transformer model during the training phase? I am trying to wrap my head around how the Transformer architecture works. I think I have a decent top-level understanding of the encoder part, sort of how the Key, Query, and Value tensors work in... datascience.stackexchange.com decoder로의 input은 token이 ..
RNN with attention(seq2seq with attention) 개요 1. 초기 RNN의 번역 task 2. seq2seq의 등장 3. seq2seq with attention의 등장 4. 마무리 초기에 RNN을 어떻게 번역 task에 적용했을까? word2vec모델 이후, 맥락을 고려할 수 있는 모델로 RNN이 등장했다. 이를 이용하여 기계 번역 task를 해결하기 위해 초기에는 통계 기반 번역인 SMT(Statistical Machine Translation)이 적용됐다. 하지만, SMT는 modeling을 할 때, feature engineering을 사람이 직접 해주어야 한다는 불편함이 존재했다. 이후, 이 문제를 해결한 딥러닝 기반 번역인 NMT(Neural Machine Translation)이 등장했고 사람의 손이 닿지 않아도 feature enginee..