public class ConvolutionLayer extends BaseLayer<ConvolutionLayer>
Layer.TrainingMode, Layer.Type
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
conf, dropoutApplied, dropoutMask, gradient, gradientsFlattened, gradientViews, index, input, iterationListeners, maskArray, optimizer, params, paramsFlattened, score, solver
Constructor and Description |
---|
ConvolutionLayer(NeuralNetConfiguration conf) |
ConvolutionLayer(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray input) |
Modifier and Type | Method and Description |
---|---|
org.nd4j.linalg.api.ndarray.INDArray |
activate(boolean training)
Trigger an activation with the last specified input
|
Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray> |
backpropGradient(org.nd4j.linalg.api.ndarray.INDArray epsilon)
Calculate the gradient relative to the error in the next layer
|
Gradient |
calcGradient(Gradient layerError,
org.nd4j.linalg.api.ndarray.INDArray indArray)
Calculate the gradient
|
double |
calcL1()
Calculate the l1 regularization term
0.0 if regularization is not used. |
double |
calcL2()
Calculate the l2 regularization term
0.0 if regularization is not used. |
void |
fit(org.nd4j.linalg.api.ndarray.INDArray input)
Fit the model to the given data
|
void |
merge(Layer layer,
int batchSize)
Averages the given logistic regression from a mini batch into this layer
|
org.nd4j.linalg.api.ndarray.INDArray |
params()
Returns the parameters of the neural network as a flattened row vector
|
org.nd4j.linalg.api.ndarray.INDArray |
preOutput(boolean training) |
void |
setParams(org.nd4j.linalg.api.ndarray.INDArray params)
Set the parameters for this model.
|
Layer |
transpose()
Return a transposed copy of the weights/bias
(this means reverse the number of inputs and outputs on the weights)
|
Layer.Type |
type()
Returns the layer type
|
accumulateScore, activate, activate, activate, activate, activate, activationMean, applyDropOutIfNecessary, applyLearningRateScoreDecay, batchSize, clear, clone, computeGradientAndScore, conf, createGradient, derivativeActivation, error, fit, getIndex, getInput, getInputMiniBatchSize, getListeners, getOptimizer, getParam, gradient, gradientAndScore, initParams, input, iterate, layerConf, numParams, numParams, paramTable, preOutput, preOutput, preOutput, score, setBackpropGradientsViewArray, setConf, setIndex, setInput, setInputMiniBatchSize, setListeners, setListeners, setMaskArray, setParam, setParams, setParamsViewArray, setParamTable, setScoreWithZ, toString, update, update, validateInput
public ConvolutionLayer(NeuralNetConfiguration conf)
public ConvolutionLayer(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.INDArray input)
public double calcL2()
Layer
calcL2
in interface Layer
calcL2
in class BaseLayer<ConvolutionLayer>
public double calcL1()
Layer
calcL1
in interface Layer
calcL1
in class BaseLayer<ConvolutionLayer>
public Layer.Type type()
Layer
type
in interface Layer
type
in class BaseLayer<ConvolutionLayer>
public Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray> backpropGradient(org.nd4j.linalg.api.ndarray.INDArray epsilon)
Layer
backpropGradient
in interface Layer
backpropGradient
in class BaseLayer<ConvolutionLayer>
epsilon
- w^(L+1)*delta^(L+1). Or, equiv: dC/da, i.e., (dC/dz)*(dz/da) = dC/da, where C
is cost function a=sigma(z) is activation.public org.nd4j.linalg.api.ndarray.INDArray preOutput(boolean training)
preOutput
in class BaseLayer<ConvolutionLayer>
public org.nd4j.linalg.api.ndarray.INDArray activate(boolean training)
Layer
activate
in interface Layer
activate
in class BaseLayer<ConvolutionLayer>
training
- training or test modepublic Layer transpose()
Layer
transpose
in interface Layer
transpose
in class BaseLayer<ConvolutionLayer>
public Gradient calcGradient(Gradient layerError, org.nd4j.linalg.api.ndarray.INDArray indArray)
Layer
calcGradient
in interface Layer
calcGradient
in class BaseLayer<ConvolutionLayer>
layerError
- the layer errorpublic void fit(org.nd4j.linalg.api.ndarray.INDArray input)
Model
fit
in interface Model
fit
in class BaseLayer<ConvolutionLayer>
input
- the data to fit the model topublic void merge(Layer layer, int batchSize)
BaseLayer
merge
in interface Layer
merge
in class BaseLayer<ConvolutionLayer>
layer
- the logistic regression layer to average into this layerbatchSize
- the batch sizepublic org.nd4j.linalg.api.ndarray.INDArray params()
BaseLayer
params
in interface Model
params
in class BaseLayer<ConvolutionLayer>
public void setParams(org.nd4j.linalg.api.ndarray.INDArray params)
Model
setParams
in interface Model
setParams
in class BaseLayer<ConvolutionLayer>
params
- the parameters for the modelCopyright © 2016. All Rights Reserved.