def test_softsign():
 def softsign(x):
  return np.divide(x, (np.ones_like(x) + np.absolute(x)))
 x = K.placeholder(ndim=2)
 f = K.function([x], [activations.softsign(x)])
 test_values = get_standard_values()
 result = f([test_values])[0]
 expected = softsign(test_values)
 assert_allclose(result, expected, rtol=1e-05)

def test_softsign ( ) : def softsign ( x ) : return np . divide ( x , ( np . ones_like ( x ) + np . absolute ( x ) ) ) x = K . placeholder ( ndim = 2 ) f = K . function ( [ x ] , [ activations . softsign ( x ) ] ) test_values = get_standard_values ( ) result = f ( [ test_values ] ) [ 0 ] expected = softsign ( test_values ) assert_allclose ( result , expected , rtol = 1e-05 )
test using a reference softsign implementation .