【发布时间】:2018-07-12 07:06:05
【问题描述】:
我正在努力在 Python 中的 tensorflow 中实现激活函数。
代码如下:
def myfunc(x):
if (x > 0):
return 1
return 0
但我总是收到错误:
不允许将
tf.Tensor用作 Pythonbool。使用if t is not None:
【问题讨论】:
标签: tensorflow tensorflow machine-learning deep-learning keras activation-function