Class SameDiffOutputLayer
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer
-
- org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer
-
- org.deeplearning4j.nn.conf.layers.samediff.SameDiffOutputLayer
-
- All Implemented Interfaces:
Serializable
,Cloneable
,TrainingConfig
public abstract class SameDiffOutputLayer extends AbstractSameDiffLayer
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer
AbstractSameDiffLayer.Builder<T extends AbstractSameDiffLayer.Builder<T>>
-
-
Field Summary
-
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 protected
SameDiffOutputLayer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
activationsVertexName()
Output layers should terminate in a single scalar value (i.e., a score) - however, sometimes the output activations (such as softmax probabilities) need to be returned.abstract SDVariable
defineLayer(SameDiff sameDiff, SDVariable layerInput, SDVariable labels, Map<String,SDVariable> paramTable)
Define the output layerLayer
instantiate(NeuralNetConfiguration conf, Collection<TrainingListener> trainingListeners, int layerIndex, INDArray layerParamsView, boolean initializeParams, DataType networkDataType)
boolean
labelsRequired()
Whether labels are required for calculating the score.-
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
-
-
-
-
Method Detail
-
defineLayer
public abstract SDVariable defineLayer(SameDiff sameDiff, SDVariable layerInput, SDVariable labels, Map<String,SDVariable> paramTable)
Define the output layer- Parameters:
sameDiff
- SameDiff instancelayerInput
- Input to the layerlabels
- Labels variable (or null iflabelsRequired()
returns falseparamTable
- Parameter table - keys as defined byAbstractSameDiffLayer.defineParameters(SDLayerParams)
- Returns:
- The final layer variable corresponding to the score/loss during forward pass. This must be a single scalar value.
-
activationsVertexName
public abstract String activationsVertexName()
Output layers should terminate in a single scalar value (i.e., a score) - however, sometimes the output activations (such as softmax probabilities) need to be returned. When this is the case, we need to know the name of the SDVariable that corresponds to these.
If the final network activations are just the input to the layer, simply return "input"- Returns:
- The name of the activations to return when performing forward pass
-
labelsRequired
public boolean labelsRequired()
Whether labels are required for calculating the score. Defaults to true - however, if the score can be calculated without labels (for example, in some output layers used for unsupervised learning) this can be set to false.- Returns:
- True if labels are required to calculate the score/output, false otherwise.
-
instantiate
public Layer instantiate(NeuralNetConfiguration conf, Collection<TrainingListener> trainingListeners, int layerIndex, INDArray layerParamsView, boolean initializeParams, DataType networkDataType)
- Specified by:
instantiate
in classAbstractSameDiffLayer
-
-