change_hidden.py 文件源码

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

项目:Twitter100k 作者: huyt16 项目源码 文件源码
def change_data(proto, datas=None):
  proto_cont = util.ReadData(proto)
  if datas is None:
    datas = []
    for m in ['image', 'text']:
      for i in [1,2,3]:
        for t in ['train', 'validation', 'test']:
          datas += [m+'_'+'hidden'+str(i)+'_'+t]
          datas += ['bae_'+m+'_'+'hidden'+str(i)+'_'+t]
          datas += ['bae_'+m+'_'+'hidden'+str(i)+'_'+t+'_all']
          datas += ['corr_'+m+'_hidden'+str(i)+'_'+t]
  for data in datas:
    try:
      data_proto = next(lay for lay in proto_cont.data if lay.name == data)
      data_proto.dimensions[0] = dimensions
    except StopIteration:
        pass
  with open(proto, 'w') as f:
    text_format.PrintMessage(proto_cont, f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号