【发布时间】:2018-01-27 21:52:55
【问题描述】:
我的 CNN 中的活动函数具有以下形式:
abs(X)< tou f = 1.716tanh(0.667x)
x >= tou f = 1.716[tanh(2tou/3)+tanh'(2tou/3)(x-tou)]
x <= -tou f = 1.716[tanh(-2tou/3)+tanh'(-2tou/3)(x+tou)]
tou 是一个常数。
因此,在 TensorFlow 中可以创建自己的激活函数。我不想用 C++ 编写它并重新编译整个 TensorFlow。
如何使用TensorFlow中提供的功能来实现?
【问题讨论】:
-
这三个条件似乎不一致。例如,当 x==tou 时会发生什么?
-
第三个条件是错误的。我再次编辑了它。请试一试。谢谢~
标签: python tensorflow neural-network activation-function