1、softsign函数

tensorflow softsign函数应用

图像

tensorflow softsign函数应用

2、tensorflow softsign应用

import tensorflow as tf

input=tf.constant([0,-1,2,-30,30],dtype=tf.float32)
output=tf.nn.softsign(input)

with tf.Session() as sess:
    print('input:')
    print(sess.run(input))
    print('output:')
    print(sess.run(output))
    sess.close()

输出结果:

input:
[ 0. -1. 2. -30. 30.]
output:
[ 0. -0.5 0.66666669 -0.96774191 0.96774191]