Image2CaptionDecoder.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:chainer-caption 作者: apple2373 项目源码 文件源码
def __init__(self, vocaburary_size, img_feature_dim=2048, hidden_dim=512,dropout_ratio=0.5,train=True, n_layers=1):
        super(Image2CaptionDecoder, self).__init__(
            embed_word=  L.EmbedID(vocaburary_size, hidden_dim),
            embed_image= L.Linear(img_feature_dim, hidden_dim),
            lstm = L.NStepLSTM(n_layers=n_layers,in_size=hidden_dim,out_size=hidden_dim,dropout=dropout_ratio),
            decode_word = L.Linear(hidden_dim, vocaburary_size),
        )
        self.dropout_ratio = dropout_ratio
        self.train = train
        self.n_layers=n_layers
        self.hidden_dim=hidden_dim
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号