Class Layer

java.lang.Object
dk.alexandra.fresco.stat.mlp.Layer
All Implemented Interfaces:
dk.alexandra.fresco.framework.DRes<Layer>

public class Layer
extends Object
implements dk.alexandra.fresco.framework.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, dk.alexandra.fresco.framework.builder.numeric.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, dk.alexandra.fresco.framework.builder.numeric.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, dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric inputBuilder)  
    Layer​(int in, int out, Random prng, dk.alexandra.fresco.framework.builder.numeric.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​(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> weights, ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.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<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> getBias()  
    dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> getWeights()  
    Layer out()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Layer

      public Layer​(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> weights, ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.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, dk.alexandra.fresco.framework.builder.numeric.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, dk.alexandra.fresco.framework.builder.numeric.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, dk.alexandra.fresco.framework.builder.numeric.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, dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric inputBuilder)
  • Method Details

    • getWeights

      public dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> getWeights()
    • getBias

      public ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> getBias()
    • out

      public Layer out()
      Specified by:
      out in interface dk.alexandra.fresco.framework.DRes<Layer>