layers.py 文件源码

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

项目:deeppavlov 作者: deepmipt 项目源码 文件源码
def projection(encoding, W, dropout_rate):
    """Projection layer. Dense layer from keras.

    In FastQA is applied after the encoder, to project context and question representations
    into different spaces."""

    proj = TimeDistributed(
        Dense(W,
              trainable=True,
              weights=np.concatenate((np.eye(W), np.eye(W)), axis=1)))(encoding)
    proj = Dropout(rate=dropout_rate)(proj)
    return proj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号