美文网首页
openmnt读源码记录

openmnt读源码记录

作者: 柴柴总 | 来源:发表于2020-10-30 14:26 被阅读0次
    • 模型构建文件
      位置:OpenNMT-py\onmt\model_builder.py
      """
      This file is for models creation, which consults options
      and creates each encoder and decoder accordingly.
      """
      
    • Embeddings module 文档有介绍
      位置:OpenNMT-py\onmt\modules\embeddings.py
      里面有个feat相关参数(见下面的代码),可能可以用来加时态特征
      # Dimensions and padding for feature embedding matrices
          # (these have no effect if feat_vocab_sizes is empty)
          if feat_merge == 'sum':
              feat_dims = [word_vec_size] * len(feat_vocab_sizes)
          elif feat_vec_size > 0:
              feat_dims = [feat_vec_size] * len(feat_vocab_sizes)
          else:
              feat_dims = [int(vocab ** feat_vec_exponent)
                           for vocab in feat_vocab_sizes]
      
      openmnt上关于feature emb的讨论贴
      添加额外特征的官方教程

    相关文章

      网友评论

          本文标题:openmnt读源码记录

          本文链接:https://www.haomeiwen.com/subject/drimyctx.html