Class InputLayer

java.lang.Object
deepnetts.net.layers.AbstractLayer
deepnetts.net.layers.InputLayer
All Implemented Interfaces:
Backward, Forward, Layer, Serializable

public class InputLayer extends AbstractLayer
Input layer in a neural network. It is always the first layer in the network. It accepts external input, and sends it for processing to the next layer in a network. Inputs are given as tensors of float values.
Author:
Zoran Sevarac
See Also:
  • Constructor Details

    • InputLayer

      public InputLayer(int depth, int width, int height)
      Creates input layer with specified width, height, and depth (number of channels).
      Parameters:
      depth - layer depth (number of input channels)
      width - layer width
      height - layer height
    • InputLayer

      public InputLayer(int batchSize, int depth, int width, int height)
    • InputLayer

      public InputLayer(int width, int batchSize)
      Creates input layer with specified width and height, and depth=1 (single depth/channel).
      Parameters:
      width - layer width
      batchSize - layer height or batchSize
    • InputLayer

      public InputLayer(int width, int batchSize, boolean isGPU)
    • InputLayer

      public InputLayer(int width)
      Creates input layer with specified width, and with height and depth equals to one.
      Parameters:
      width - layer width
  • Method Details

    • init

      public final void init()
      Initialize this layer in network.
      Specified by:
      init in class AbstractLayer
    • setInput

      public void setInput(TensorBase in)
      Sets network input
      Parameters:
      in - input matrix/array
    • forward

      public void forward()
      This method does nothing in the input layer, and should never be called.
      Specified by:
      forward in interface Forward
      Specified by:
      forward in interface Layer
      Specified by:
      forward in class AbstractLayer
    • backward

      public void backward()
      This method does nothing in the input layer, and should never be called.
      Specified by:
      backward in interface Backward
      Specified by:
      backward in interface Layer
      Specified by:
      backward in class AbstractLayer
    • applyWeightChanges

      public void applyWeightChanges()
      This method does nothing in input layer.
      Specified by:
      applyWeightChanges in class AbstractLayer
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTensorDim

      public int getTensorDim()