public abstract class Layer
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Layer.Builder<T extends Layer.Builder<T>> |
Modifier and Type | Field and Description |
---|---|
protected org.nd4j.linalg.activations.IActivation |
activationFn |
protected double |
adamMeanDecay |
protected double |
adamVarDecay |
protected double |
biasInit |
protected double |
biasLearningRate |
protected Distribution |
dist |
protected double |
dropOut |
protected double |
epsilon |
protected GradientNormalization |
gradientNormalization |
protected double |
gradientNormalizationThreshold |
protected double |
l1 |
protected double |
l1Bias |
protected double |
l2 |
protected double |
l2Bias |
protected java.lang.String |
layerName |
protected double |
learningRate |
protected java.util.Map<java.lang.Integer,java.lang.Double> |
learningRateSchedule |
protected double |
momentum |
protected java.util.Map<java.lang.Integer,java.lang.Double> |
momentumSchedule |
protected double |
rho |
protected double |
rmsDecay |
protected Updater |
updater |
protected WeightInit |
weightInit |
Constructor and Description |
---|
Layer(Layer.Builder builder) |
Modifier and Type | Method and Description |
---|---|
Layer |
clone() |
abstract double |
getL1ByParam(java.lang.String paramName)
Get the L1 coefficient for the given parameter.
|
abstract double |
getL2ByParam(java.lang.String paramName)
Get the L2 coefficient for the given parameter.
|
abstract double |
getLearningRateByParam(java.lang.String paramName)
Get the (initial) learning rate coefficient for the given parameter.
|
abstract InputType |
getOutputType(int layerIndex,
InputType inputType)
For a given type of input to this layer, what is the type of the output?
|
abstract InputPreProcessor |
getPreProcessorForInputType(InputType inputType)
For the given type of input to this layer, what preprocessor (if any) is required?
Returns null if no preprocessor is required, otherwise returns an appropriate InputPreProcessor
for this layer, such as a CnnToFeedForwardPreProcessor |
Updater |
getUpdaterByParam(java.lang.String paramName)
Get the updater for the given parameter.
|
abstract ParamInitializer |
initializer() |
abstract Layer |
instantiate(NeuralNetConfiguration conf,
java.util.Collection<IterationListener> iterationListeners,
int layerIndex,
org.nd4j.linalg.api.ndarray.INDArray layerParamsView,
boolean initializeParams) |
void |
resetLayerDefaultConfig()
Reset the learning related configs of the layer to default.
|
abstract void |
setNIn(InputType inputType,
boolean override)
Set the nIn value (number of inputs, or input depth for CNNs) based on the given input type
|
protected java.lang.String layerName
protected org.nd4j.linalg.activations.IActivation activationFn
protected WeightInit weightInit
protected double biasInit
protected Distribution dist
protected double learningRate
protected double biasLearningRate
protected java.util.Map<java.lang.Integer,java.lang.Double> learningRateSchedule
protected double momentum
protected java.util.Map<java.lang.Integer,java.lang.Double> momentumSchedule
protected double l1
protected double l2
protected double l1Bias
protected double l2Bias
protected double dropOut
protected Updater updater
protected double rho
protected double epsilon
protected double rmsDecay
protected double adamMeanDecay
protected double adamVarDecay
protected GradientNormalization gradientNormalization
protected double gradientNormalizationThreshold
public Layer(Layer.Builder builder)
public void resetLayerDefaultConfig()
public Layer clone()
clone
in class java.lang.Object
public abstract Layer instantiate(NeuralNetConfiguration conf, java.util.Collection<IterationListener> iterationListeners, int layerIndex, org.nd4j.linalg.api.ndarray.INDArray layerParamsView, boolean initializeParams)
public abstract ParamInitializer initializer()
public abstract InputType getOutputType(int layerIndex, InputType inputType)
layerIndex
- Index of the layerinputType
- Type of input for the layerjava.lang.IllegalStateException
- if input type is invalid for this layerpublic abstract void setNIn(InputType inputType, boolean override)
inputType
- Input type for this layeroverride
- If false: only set the nIn value if it's not already set. If true: set it regardless of whether it's
already set or not.java.lang.IllegalStateException
- if input type is invalid for this layerpublic abstract InputPreProcessor getPreProcessorForInputType(InputType inputType)
InputPreProcessor
for this layer, such as a CnnToFeedForwardPreProcessor
inputType
- InputType to this layerjava.lang.IllegalStateException
- if input type is invalid for this layerpublic abstract double getL1ByParam(java.lang.String paramName)
paramName
- Parameter namepublic abstract double getL2ByParam(java.lang.String paramName)
paramName
- Parameter namepublic abstract double getLearningRateByParam(java.lang.String paramName)
paramName
- Parameter namepublic Updater getUpdaterByParam(java.lang.String paramName)
paramName
- Parameter name