Class LayerBuilder

java.lang.Object
smile.base.mlp.LayerBuilder
Direct Known Subclasses:
HiddenLayerBuilder, OutputLayerBuilder

public abstract class LayerBuilder extends Object
The builder of layers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final double
    The dropout rate.
    protected final int
    The number of neurons.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LayerBuilder(int neurons, double dropout)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Layer
    build(int p)
    Builds a layer.
    int
    Returns the number of neurons.

    Methods inherited from class java.lang.Object

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

    • neurons

      protected final int neurons
      The number of neurons.
    • dropout

      protected final double dropout
      The dropout rate.
  • Constructor Details

    • LayerBuilder

      public LayerBuilder(int neurons, double dropout)
      Constructor.
      Parameters:
      neurons - the number of neurons.
      dropout - the dropout rate.
  • Method Details

    • neurons

      public int neurons()
      Returns the number of neurons.
      Returns:
      the number of neurons.
    • build

      public abstract Layer build(int p)
      Builds a layer.
      Parameters:
      p - the number of input variables (not including bias value).
      Returns:
      a layer.