본문 바로가기

분류 전체보기

(120)
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이 같은지 같..
공백 입력이 들어왔을 때, while문 종료하기 while True: name = input("입력해주세요: ") if not name.strip(): print("아무 것도 입력하지 않았으므로, 종료합니다.") break else: print("계속 실행") print(name)
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..
Why do we need to add bias in neural networks? https://www.turing.com/kb/necessity-of-bias-in-neural-networks#what-is-bias-in-a-neural-network? Importance of Neural Network Bias and How to Add It Explore the role that neural network bias plays in deep learning and machine learning models and learn the ins and outs of how to add it to your own model. www.turing.com neural networks에서 weights에 bias를 더해주는 이유는 학습이 원활하게 이루어지도록 돕기 위함이다.
Why RNN share the same weights? https://stackoverflow.com/questions/47865034/recurrent-nns-whats-the-point-of-parameter-sharing-doesnt-padding-do-the-tri Recurrent NNs: what's the point of parameter sharing? Doesn't padding do the trick anyway? The following is how I understand the point of parameter sharing in RNNs: In regular feed-forward neural networks, every input unit is assigned an individual parameter, which means that..