HyperNetwork_max.py 文件源码

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

项目:ppap 作者: unique-horn 项目源码 文件源码
def setup_output(self, x):
    """
    Setup output tensor

    """
    x_max = K.max(x, axis=1)

    x_max = K.flatten(x_max)
    z = K.dot(x_max, self.w_proj_to_z) #+ self.b_proj_to_z
    hidden = K.dot(z, self.weights[0]) + self.biases[0]
    hidden = K.reshape(hidden, shape=(self.input_channels,
                                      self.hidden_dim))

    output = K.dot(hidden, self.weights[1]) + self.biases[1]

    self.output = K.reshape(output, (self.num_filters, self.input_channels,
                                     *self.output_shape))
    return self.output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号