Open uhhyunjoo opened 2 years ago
link | |
---|---|
paper | HowTo100M: Learning a Text-Video Embedding by Watching Hundred Million Narrated Video Clips |
code | papers with code |
etc | official web page |
Embedding function
Similarity
Loss
Sampling strategy
saturation 이란, activation function 의 gradient 가 0에 가까워져 weight 가 더 이상 update 되지 않는 현상을 의미함. (일종의 gradient vanishing) 해당 논문에서 activation function 으로 사용하는 sigmoid function 은 saturation 현상이 발생할 수 있다는 단점을 갖고 있음.
🤔 데이터의 양과 saturation 문제는 직접적인 관련이 있는 것인가? gradient vanishing 은 layer 갯수와 더 직접적인 관련이 있는 게 아녔나? 그리고 해당 모델은 왜 relu 같은 함수가 아닌, saturation 이 발생할 수 있는 sigmoid 를 사용하는가?
embedding model 관련 논문
max-margin ranking loss 관련 논문
negative sampling strategy 관련 논문
Appendix 에 있는 positive pair sampling strategy 에 대한 empirical analysis
논문 : An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (ViT)
These findings suggest that compute might be a better predictor of performance than the number of parameters, and that scaling should emphasize depth over width if any.
이 그림에서, patches 들의 수가 sequence length 를 뜻한다...!
3D CNN : Kinetics pre-trained ResNeXt-101 16-frames model (1.5 features per second) → video-level features (2048 차원)
def __getitem__(self, idx):
# breakpoint()
vid = self.csv['video_id'].values[idx] # id
rind = random.randint(0, len(self.sentences[vid]) - 1)
sentence = self.sentences[vid][rind]
feat_2d = F.normalize(self.features['2d'][vid].float(), dim=0)
feat_3d = F.normalize(self.features['3d'][vid].float(), dim=0)
###
# print('feat:', self.features['2d'][vid].float().shape, self.features['3d'][vid].float().shape)
# feat: torch.Size([2048]) torch.Size([2048])
###
video = th.cat((feat_2d, feat_3d))
caption = self._words_to_we(self._tokenize_text(sentence))
# print(feat_2d.shape, feat_3d.shape, video.shape, caption.shape)
# torch.Size([2048]) torch.Size([2048]) torch.Size([4096]) torch.Size([20, 300])
# print(sentence, self._tokenize_text(sentence), caption.shape)
# a rock band is performng at a concert in a club
# ['a', 'rock', 'band', 'is', 'performng', 'at', 'a', 'concert', 'in', 'a', 'club']
# torch.Size([20, 300])
return {'video': video, 'text': caption}