Class SameDiffLayer
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer
-
- org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer
-
- org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer
-
- All Implemented Interfaces:
Serializable,Cloneable,TrainingConfig
- Direct Known Subclasses:
CapsuleLayer,LearnedSelfAttentionLayer,LocallyConnected1D,LocallyConnected2D,PrimaryCapsules,RecurrentAttentionLayer,SameDiffLambdaLayer,SelfAttentionLayer
public abstract class SameDiffLayer extends AbstractSameDiffLayer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSameDiffLayer.Builder<T extends SameDiffLayer.Builder<T>>
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,IWeightInit>paramWeightInitprotected WeightInitweightInit-
Fields inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer
biasUpdater, gradientNormalization, gradientNormalizationThreshold, regularization, regularizationBias, updater
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.Layer
constraints, iDropout, layerName
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSameDiffLayer()protectedSameDiffLayer(SameDiffLayer.Builder builder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SDVariabledefineLayer(SameDiff sameDiff, SDVariable layerInput, Map<String,SDVariable> paramTable, SDVariable mask)Define the layerPair<INDArray,MaskState>feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize)Layerinstantiate(NeuralNetConfiguration conf, Collection<TrainingListener> trainingListeners, int layerIndex, INDArray layerParamsView, boolean initializeParams, DataType networkDataType)voidvalidateInput(INDArray input)Validate input arrays to confirm that they fulfill the assumptions of the layer.-
Methods inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer
applyGlobalConfig, applyGlobalConfigToLayer, defineParameters, getLayerParams, getMemoryReport, getPreProcessorForInputType, getRegularizationByParam, getUpdaterByParam, initializeParameters, initializer, initWeights, isPretrainParam, onesMaskForInput, paramReshapeOrder, setNIn
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer
clone, getOutputType, initializeConstraints, resetLayerDefaultConfig, setDataType
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.deeplearning4j.nn.api.TrainingConfig
getGradientNormalization, getGradientNormalizationThreshold, getLayerName
-
-
-
-
Field Detail
-
weightInit
protected WeightInit weightInit
-
paramWeightInit
protected Map<String,IWeightInit> paramWeightInit
-
-
Constructor Detail
-
SameDiffLayer
protected SameDiffLayer(SameDiffLayer.Builder builder)
-
SameDiffLayer
protected SameDiffLayer()
-
-
Method Detail
-
defineLayer
public abstract SDVariable defineLayer(SameDiff sameDiff, SDVariable layerInput, Map<String,SDVariable> paramTable, SDVariable mask)
Define the layer- Parameters:
sameDiff- SameDiff instancelayerInput- Input to the layerparamTable- Parameter table - keys as defined byAbstractSameDiffLayer.defineParameters(SDLayerParams)mask- Optional, maybe null. Mask to apply if supported- Returns:
- The final layer variable corresponding to the activations/output from the forward pass
-
feedForwardMaskArray
public Pair<INDArray,MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize)
-
validateInput
public void validateInput(INDArray input)
Validate input arrays to confirm that they fulfill the assumptions of the layer. If they don't, throw an exception.- Parameters:
input- input to the layer
-
instantiate
public Layer instantiate(NeuralNetConfiguration conf, Collection<TrainingListener> trainingListeners, int layerIndex, INDArray layerParamsView, boolean initializeParams, DataType networkDataType)
- Specified by:
instantiatein classAbstractSameDiffLayer
-
-