로딩
요청 처리 중입니다...

(pytorch) torch.nn.Embedding

 (pytorch) torch.nn.Embedding

nn.Embedding() Embedding — PyTorch 1.11.0 documentation Parameters num_embeddings ( int ) – size of the dictionary of embeddings embedding_dim ( int ) – the size of each embedding vector padding_idx ( int , optional ) – If specified, the entries at padding_idx do not contribute to the gradient; therefore, the embedding vector at padding_idx is not update... pytorch.org 코드 리뷰를 하다가 신기한 기술을 보았다. 바로 label 정보를 Embedding 차원으로 매핑하여 네트워크의 input으로 넣는 것이다.

아래와 같이 input feature에 label 정보를 추가할 수 있다는 것을 알게되었...