Class FullyConnectedLayer

java.lang.Object
smile.deep.layer.FullyConnectedLayer
All Implemented Interfaces:
Function<Tensor,Tensor>, Layer

public class FullyConnectedLayer extends Object implements Layer
A fully connected layer with nonlinear activation function.
  • Constructor Details

    • FullyConnectedLayer

      public FullyConnectedLayer(int in, int out)
      Constructor.
      Parameters:
      in - the number of input features.
      out - the number of output features.
  • Method Details

    • asTorch

      public org.bytedeco.pytorch.Module asTorch()
      Description copied from interface: Layer
      Returns the PyTorch Module object.
      Specified by:
      asTorch in interface Layer
      Returns:
      the PyTorch Module object.
    • forward

      public Tensor forward(Tensor input)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Specified by:
      forward in interface Layer
      Parameters:
      input - the input tensor.
      Returns:
      the output tensor.