Class Layer

Object
Layer
All Implemented Interfaces:
DRes<Layer>

public class Layer
extends Object
implements DRes<Layer>
Instances of this class represents fully connected layers in a neural network. Instances are immutable.
  • Constructor Summary

    Constructors 
    Constructor Description
    Layer​(double[][] weights, double[] bias, ProtocolBuilderNumeric inputBuilder)
    Create a new fully connected layer with the given weights and biases and using a sigmoid activation function.
    Layer​(double[][] weights, double[] bias, ProtocolBuilderNumeric inputBuilder, ActivationFunction activationFunction)
    Create a new fully connected layer with the given open weights, biases and activation function.
    Layer​(int in, int out, Random prng, ProtocolBuilderNumeric inputBuilder)  
    Layer​(int in, int out, Random prng, ProtocolBuilderNumeric inputBuilder, ActivationFunction activationFunction)
    Create a new layer with random weights (bias is zero and weights are distributed as a standard Gaussian distribution divided by the number of neurons.
    Layer​(Matrix<DRes<SFixed>> weights, ArrayList<DRes<SFixed>> bias, ActivationFunction activationFunction)
    Create a new fully connected layer with the given secret weights, biases and activation function.
  • Method Summary

    Modifier and Type Method Description
    ArrayList<DRes<SFixed>> getBias()  
    Matrix<DRes<SFixed>> getWeights()  
    Layer out()  
  • Constructor Details

    • Layer

      public Layer​(Matrix<DRes<SFixed>> weights, ArrayList<DRes<SFixed>> bias, ActivationFunction activationFunction)
      Create a new fully connected layer with the given secret weights, biases and activation function.
    • Layer

      public Layer​(double[][] weights, double[] bias, ProtocolBuilderNumeric inputBuilder, ActivationFunction activationFunction)
      Create a new fully connected layer with the given open weights, biases and activation function.
    • Layer

      public Layer​(double[][] weights, double[] bias, ProtocolBuilderNumeric inputBuilder)
      Create a new fully connected layer with the given weights and biases and using a sigmoid activation function.
    • Layer

      public Layer​(int in, int out, Random prng, ProtocolBuilderNumeric inputBuilder, ActivationFunction activationFunction)
      Create a new layer with random weights (bias is zero and weights are distributed as a standard Gaussian distribution divided by the number of neurons.
    • Layer

      public Layer​(int in, int out, Random prng, ProtocolBuilderNumeric inputBuilder)
  • Method Details