Class InputLayer

  • All Implemented Interfaces:
    java.io.Serializable

    public class InputLayer
    extends Layer
    Layer for input.

    Basically all functions are no-ops.

    See Also:
    Serialized Form
    • Constructor Detail

      • InputLayer

        public InputLayer​(int size)
        Create an input layer.
        Parameters:
        size - size of the input
    • Method Detail

      • initLayer

        public void initLayer​(int prevSize,
                              Activation prevActivation)
        No op.
        Specified by:
        initLayer in class Layer
        Parameters:
        prevSize - size of the previous layer (can be anything)
        prevActivation - activation function or previous layer
      • getActivation

        public Activation getActivation()
        Return a linear activation.
        Specified by:
        getActivation in class Layer
        Returns:
        a new linear activation
      • getOutSize

        public int getOutSize()
        Description copied from class: Layer
        Get the output size of the layer.
        Specified by:
        getOutSize in class Layer
        Returns:
        the output size
      • forwardPropagate

        public Matrix forwardPropagate​(Matrix x)
        No op forward propagation.
        Specified by:
        forwardPropagate in class Layer
        Parameters:
        x - input matrix
        Returns:
        the same input matrix
      • setOptimizers

        public void setOptimizers​(Optimizer wOptimizer,
                                  Optimizer bOptimizer)
        No op.
        Specified by:
        setOptimizers in class Layer
        Parameters:
        wOptimizer - optimizer for weights
        bOptimizer - optimizer for biases
      • cloneLayer

        public Layer cloneLayer()
        Description copied from class: Layer
        Clone the layer, including weights and biases.
        Specified by:
        cloneLayer in class Layer
        Returns:
        the clone
      • getErrors

        public Matrix getErrors​(Matrix prevErrors)
        No op.
        Specified by:
        getErrors in class Layer
        Parameters:
        prevErrors - errors from previous layer (layer after output)
        Returns:
        null
      • getErrorsExpected

        public Matrix getErrorsExpected​(Matrix y)
        No op.
        Specified by:
        getErrorsExpected in class Layer
        Parameters:
        y - expected outputs
        Returns:
        null
      • update

        public void update​(Matrix errors)
        No op. Nothing is updated.
        Specified by:
        update in class Layer
        Parameters:
        errors - calculated errors
      • toString

        public java.lang.String toString()
        Description copied from class: Layer
        Get a string representation.
        Specified by:
        toString in class Layer
        Returns:
        the string
      • cloneSettings

        public InputLayer cloneSettings()
        Description copied from class: Layer
        Clone the settings.

        This will return a layer with the same size and activation, but with randomly initialized weights and biases.

        Specified by:
        cloneSettings in class Layer
        Returns:
        the clone