Package smile.base.mlp
Class LayerBuilder
java.lang.Object
smile.base.mlp.LayerBuilder
- Direct Known Subclasses:
HiddenLayerBuilder
,OutputLayerBuilder
The builder of layers.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
neurons
protected final int neuronsThe number of neurons. -
dropout
protected final double dropoutThe 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
Builds a layer.- Parameters:
p
- the number of input variables (not including bias value).- Returns:
- a layer.
-