public abstract static class BaseLayer.Builder<T extends BaseLayer.Builder<T>> extends Layer.Builder<T>
Modifier and Type | Field and Description |
---|---|
protected org.nd4j.linalg.activations.IActivation |
activationFn |
protected double |
biasInit |
protected org.nd4j.linalg.learning.config.IUpdater |
biasUpdater |
protected Distribution |
dist |
protected GradientNormalization |
gradientNormalization |
protected double |
gradientNormalizationThreshold |
protected org.nd4j.linalg.learning.config.IUpdater |
iupdater |
protected double |
l1 |
protected double |
l1Bias |
protected double |
l2 |
protected double |
l2Bias |
protected WeightInit |
weightInit |
protected IWeightNoise |
weightNoise |
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
T |
activation(org.nd4j.linalg.activations.Activation activation)
Set the activation function for the layer, from an
Activation enumeration value. |
T |
activation(org.nd4j.linalg.activations.IActivation activationFunction)
Set the activation function for the layer.
|
T |
biasInit(double biasInit)
Bias initialization value, for layers with biases.
|
T |
biasUpdater(org.nd4j.linalg.learning.config.IUpdater biasUpdater)
Gradient updater configuration, for the biases only.
|
T |
dist(Distribution dist)
Distribution to sample initial weights from.
|
T |
gradientNormalization(GradientNormalization gradientNormalization)
Gradient normalization strategy.
|
T |
gradientNormalizationThreshold(double threshold)
Threshold for gradient normalization, only used for GradientNormalization.ClipL2PerLayer,
GradientNormalization.ClipL2PerParamType, and GradientNormalization.ClipElementWiseAbsoluteValue
Not used otherwise. L2 threshold for first two types of clipping, or absolute value threshold for last type of clipping. |
T |
l1(double l1)
L1 regularization coefficient (weights only).
|
T |
l1Bias(double l1Bias)
L1 regularization coefficient for the bias.
|
T |
l2(double l2)
L2 regularization coefficient (weights only).
|
T |
l2Bias(double l2Bias)
L2 regularization coefficient for the bias.
|
T |
updater(org.nd4j.linalg.learning.config.IUpdater updater)
Gradient updater.
|
T |
updater(Updater updater)
Deprecated.
|
T |
weightInit(Distribution distribution)
Set weight initialization scheme to random sampling via the specified distribution.
|
T |
weightInit(WeightInit weightInit)
Weight initialization scheme to use, for initial weight values
|
T |
weightNoise(IWeightNoise weightNoise)
Set the weight noise (such as
DropConnect and
WeightNoise ) for this layer |
build, constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
protected org.nd4j.linalg.activations.IActivation activationFn
protected WeightInit weightInit
protected double biasInit
protected Distribution dist
protected double l1
protected double l2
protected double l1Bias
protected double l2Bias
protected org.nd4j.linalg.learning.config.IUpdater iupdater
protected org.nd4j.linalg.learning.config.IUpdater biasUpdater
protected GradientNormalization gradientNormalization
protected double gradientNormalizationThreshold
protected IWeightNoise weightNoise
public T activation(org.nd4j.linalg.activations.IActivation activationFunction)
IActivation
instancesactivationFunction
- Activation function to use for the layerpublic T activation(org.nd4j.linalg.activations.Activation activation)
Activation
enumeration value.activation
- Activation function to use for the layerpublic T weightInit(WeightInit weightInit)
WeightInit
public T weightInit(Distribution distribution)
.weightInit(WeightInit.DISTRIBUTION).dist(distribution)
distribution
- Distribution to use for weight initializationpublic T biasInit(double biasInit)
biasInit
- Value to use for initializing biasespublic T dist(Distribution dist)
public T l1(double l1)
l1Bias(double)
to configure the l1 regularization
coefficient for the bias.public T l2(double l2)
l2Bias(double)
to configure the l2 regularization
coefficient for the bias.public T l1Bias(double l1Bias)
l1(double)
public T l2Bias(double l2Bias)
l2(double)
@Deprecated public T updater(Updater updater)
Updater
public T updater(org.nd4j.linalg.learning.config.IUpdater updater)
Adam
or Nesterovs
updater
- Updater to usepublic T biasUpdater(org.nd4j.linalg.learning.config.IUpdater biasUpdater)
updater(IUpdater)
biasUpdater
- Updater to use for bias parameterspublic T gradientNormalization(GradientNormalization gradientNormalization)
gradientNormalization
- Type of normalization to use. Defaults to None.GradientNormalization
public T gradientNormalizationThreshold(double threshold)
public T weightNoise(IWeightNoise weightNoise)
DropConnect
and
WeightNoise
) for this layerweightNoise
- Weight noise instance to useCopyright © 2018. All rights reserved.