Package org.deeplearning4j.nn.api.layers
Interface IOutputLayer
-
- All Superinterfaces:
Classifier
,Cloneable
,Layer
,Model
,Serializable
,Trainable
- All Known Implementing Classes:
BaseOutputLayer
,CenterLossOutputLayer
,Cnn3DLossLayer
,CnnLossLayer
,LossLayer
,OCNNOutputLayer
,OutputLayer
,RnnLossLayer
,RnnOutputLayer
,SameDiffOutputLayer
,Yolo2OutputLayer
public interface IOutputLayer extends Layer, Classifier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.deeplearning4j.nn.api.Layer
Layer.TrainingMode, Layer.Type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
computeScore(double fullNetworkRegScore, boolean training, LayerWorkspaceMgr workspaceMgr)
Compute score after labels and input have been set.INDArray
computeScoreForExamples(double fullNetworkRegScore, LayerWorkspaceMgr workspaceMgr)
Compute the score for each example individually, after labels and input have been set.INDArray
getLabels()
Get the labels array previously set withsetLabels(INDArray)
boolean
needsLabels()
Returns true if labels are required for this output layervoid
setLabels(INDArray labels)
Set the labels array for this output layer-
Methods inherited from interface org.deeplearning4j.nn.api.Classifier
f1Score, f1Score, fit, fit, fit, fit, numLabels, predict, predict
-
Methods inherited from interface org.deeplearning4j.nn.api.Layer
activate, activate, allowInputModification, backpropGradient, calcRegularizationScore, clearNoiseWeightParams, feedForwardMaskArray, getEpochCount, getHelper, getIndex, getInputMiniBatchSize, getIterationCount, getListeners, getMaskArray, isPretrainLayer, setCacheMode, setEpochCount, setIndex, setInput, setInputMiniBatchSize, setIterationCount, setListeners, setListeners, setMaskArray, type
-
Methods inherited from interface org.deeplearning4j.nn.api.Model
addListeners, applyConstraints, batchSize, clear, close, computeGradientAndScore, conf, fit, fit, getGradientsViewArray, getOptimizer, getParam, gradient, gradientAndScore, init, input, numParams, numParams, params, paramTable, paramTable, score, setBackpropGradientsViewArray, setConf, setParam, setParams, setParamsViewArray, setParamTable, update, update
-
Methods inherited from interface org.deeplearning4j.nn.api.Trainable
getConfig, getGradientsViewArray, numParams, params, paramTable, updaterDivideByMinibatch
-
-
-
-
Method Detail
-
needsLabels
boolean needsLabels()
Returns true if labels are required for this output layer- Returns:
- true if this output layer needs labels or not
-
setLabels
void setLabels(INDArray labels)
Set the labels array for this output layer- Parameters:
labels
- Labels array to set
-
getLabels
INDArray getLabels()
Get the labels array previously set withsetLabels(INDArray)
- Returns:
- Labels array, or null if it has not been set
-
computeScore
double computeScore(double fullNetworkRegScore, boolean training, LayerWorkspaceMgr workspaceMgr)
Compute score after labels and input have been set.- Parameters:
fullNetworkRegScore
- Regularization score (l1/l2/weight decay) for the entire networktraining
- whether score should be calculated at train or test time (this affects things like application of dropout, etc)- Returns:
- score (loss function)
-
computeScoreForExamples
INDArray computeScoreForExamples(double fullNetworkRegScore, LayerWorkspaceMgr workspaceMgr)
Compute the score for each example individually, after labels and input have been set.- Parameters:
fullNetworkRegScore
- Regularization score (l1/l2/weight decay) for the entire network- Returns:
- A column INDArray of shape [numExamples,1], where entry i is the score of the ith example
-
-