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

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