dragen1860 / Deep-Learning-with-TensorFlow-book

深度学习入门开源书,基于TensorFlow 2.0案例实战。Open source Deep Learning book, based on TensorFlow 2.0 framework.
http://www.ai101edu.com
13.21k stars 4.08k forks source link

第五章 5.5 数据限幅 P12 #107

Closed NormanBeta closed 4 years ago

NormanBeta commented 4 years ago

那么 ReLU 函数可以实现为: 通过组合 tf.maximum(x, a)和 tf.minimum(x, b)可以实现同时对数据的上下边界限幅: 𝑥 ∈ [𝑎, 𝑏]: def relu(x): return tf.minimum(x,0.) # 下限幅为 0 即可

下限幅函数是maximun, 此处应改为return tf.maximun(x,0.)

dragen1860 commented 4 years ago

收到!谢谢。