【问题标题】:creating a customized non_linearity like relu6创建像 relu6 这样的自定义非线性
【发布时间】:2019-11-23 18:03:58
【问题描述】:

有人可以帮我找到允许我修复阈值(最大值)不超过 relu6 的函数。

我试过了

 X = max(X , 6) 

但我收到了这个错误:

(OperatorNotAllowedInGraphError: 在 Graph 执行中不允许使用 tf.Tensor 作为 Python bool。使用 Eager 执行或使用 @tf.function 装饰此函数)

。 提前谢谢你

【问题讨论】:

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


【解决方案1】:

你可能想试试:

X = tf.math.maximum(X,6)

详情请看:https://www.tensorflow.org/api_docs/python/tf/math/maximum

我希望这会有所帮助。

【讨论】:

  • 非常感谢,我试过了,但我收到了那个错误:AttributeError: 'NoneType' object has no attribute '_inbound_nodes'
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-30
  • 2018-07-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多