Linear

public class Linear

Linear activation function (pass-through).

The linear activation returns its input. It is also known as the Identity activation function.

For example:

    Operand<TFloat32> input = tf.constant(
              new float[] {-3.0f,-1.0f, 0.0f,1.0f,3.0f});
    Linear<TFloat32> linear = new Linear<>(tf);
    Operand<TFloat32> result = linear.call(input);
    // result is [-3.0f,-1.0f, 0.0f,1.0f,3.0f]
 

Public Constructors

Linear(Ops tf)
Creates a linear activation.

Public Methods

Operand<U>
call(Operand<U> input)
Gets the calculation operation for the activation.

Inherited Methods

Public Constructors

public Linear (Ops tf)

Creates a linear activation.

Parameters
tf the TensorFlow Ops

Public Methods

public Operand<U> call (Operand<U> input)

Gets the calculation operation for the activation.

Parameters
input the input tensor
Returns
  • The operand for the activation