Class Softsign
java.lang.Object
org.tensorflow.framework.activations.AbstractActivation
org.tensorflow.framework.activations.Softsign
- All Implemented Interfaces:
Activation
Softsign activation function,
softsign(x) = x / (abs(x) + 1).
Example Usage:
Operand<TFloat32> input = tf.constant(
new float[] {-1.0f, 0.0f, 1.0f});
Softsign<TFloat32> softsign = new Softsign<>(tf);
Operand<TFloat32> result = softsign.call(input);
// result is [-0.5f, 0.f, 0.5f]
-
Field Summary
FieldsFields inherited from class AbstractActivation
NAME_KEY, tf -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the calculation operation for the activation.Gets a configuration mapgetName()Get the name of the activation as known by the TensorFlow EngineApplies the Softsign activation function,softsign(x) = x / (abs(x) + 1).Methods inherited from class AbstractActivation
checkClassName, checkConfigKeys, getDefaultConfig, getTF, setTF
-
Field Details
-
NAME
-
-
Constructor Details
-
Softsign
public Softsign()Creates a Softsign activation. -
Softsign
Creates a new Softsign from a configuration Map- Parameters:
config- the configuration map, this class does not use any of the entries in the configuration map- Throws:
IllegalArgumentException- if the configuration contains unsupported keys for this class or if the value for the name key does not match the name for the Activation
-
-
Method Details
-
softsign
Applies the Softsign activation function,softsign(x) = x / (abs(x) + 1).Example Usage:
Operand<TFloat32> input = ...; Operand<TFloat32> result = Softsign.softsign(tf, input);- Type Parameters:
T- the data type for the input- Parameters:
tf- the TensorFlow Opsinput- the input- Returns:
- the Softsign activation,
softsign(x) = x / (abs(x) + 1).
-
call
-
getConfig
Gets a configuration map- Specified by:
getConfigin classAbstractActivation- Returns:
- the configuration map
-
getName
Get the name of the activation as known by the TensorFlow Engine- Specified by:
getNamein classAbstractActivation- Returns:
- the name of the activation as known by the TensorFlow Engine
-