yt8m_frame_model.py 文件源码

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

项目:Youtube8mdataset_kagglechallenge 作者: jasonlee27 项目源码 文件源码
def load_model(self, frm_modelweights=''):
        frm_model = Sequential()
        frm_model.add(GRU(2048,
                          input_shape=(None, self.feature_size),
                          return_sequences=True,
                          activation='relu',
                          name='fc1'))
        frm_model.add(Dropout(0.5))
        frm_model.add(GRU(2048,
                          return_sequences=True,
                          activation='relu',
                          name='fc2'))
        frm_model.add(Dropout(0.5))
        frm_model.add(GRU(2048,
                          return_sequences=False,
                          activation='relu',
                          name='fc3'))
        frm_model.add(Dropout(0.5))
        frm_model.add(Dense(self.numclasses, activation='softmax', name='prediction'))
        if frm_modelweights:
            frm_model.load_weights(frm_modelweights, by_name=True)
            print("Frame model loaded with weights from %s." % frm_modelweights)
        else:
            print "Empty frame model loaded."

        return frm_model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号