Skip to content

Commit

Permalink
Add comments in Attmodel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruotianluo committed Apr 28, 2018
1 parent 7603d03 commit 5f8f7e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions models/AttModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# TopDown is from Bottom-Up and Top-Down Attention for Image Captioning and VQA
# https://arxiv.org/abs/1707.07998
# However, it may not be identical to the author's architecture.

from __future__ import absolute_import
from __future__ import division
Expand Down Expand Up @@ -423,6 +424,12 @@ def forward(self, xt, fc_feats, att_feats, p_att_feats, state, att_masks=None):
return output, state


############################################################################
# Notice:
# StackAtt and DenseAtt are models that I randomly designed.
# They are not related to any paper.
############################################################################

from .FCModel import LSTMCore
class StackAttCore(nn.Module):
def __init__(self, opt, use_maxout=False):
Expand Down Expand Up @@ -567,6 +574,11 @@ def forward(self, xt, fc_feats, att_feats, p_att_feats, state, att_masks=None):
state = (next_h.unsqueeze(0), next_c.unsqueeze(0))
return output, state


"""
Note this is my attempt to replicate att2all model in self-critical paper.
However, this is not a correct replication actually. Will fix it.
"""
class Att2all2Core(nn.Module):
def __init__(self, opt):
super(Att2all2Core, self).__init__()
Expand Down

0 comments on commit 5f8f7e7

Please sign in to comment.