如何使用占位符输入来计算自我注意力?

时间:2020-02-06 05:39:23

标签: python tensorflow keras keras-layer tf.keras

使用:

  1. Tensorflow 1.13.1

  2. keras == 2.2.4

我无法使用尺寸为[None,None,None,n_channel]的占位符来创建自我关注图,因为自我关注矩阵需要H和W。 H * W将返回NoneType*NoneType乘法错误。

Code that uses Layer Module of Keras。这需要放在自定义net()函数内部,该函数使用以下占位符作为输入。 A sample of a custom model function I'm trying to replicate for my case.

输入为self.x_placehoder = tf.placeholder(shape=(None, None, None, n_channel), dtype=tf.float32)

0 个答案:

没有答案
相关问题