public class Upsampling2D extends AbstractLayer<Upsampling2D>
Used for upsampling a 2D convolution
Layer.TrainingMode, Layer.Type
cacheMode, conf, dropoutApplied, dropoutMask, epochCount, index, input, iterationCount, iterationListeners, maskArray, maskState, preOutput
Constructor and Description |
---|
Upsampling2D(NeuralNetConfiguration conf) |
Upsampling2D(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray input) |
Modifier and Type | Method and Description |
---|---|
void |
accumulateScore(double accum)
Sets a rolling tally for the score.
|
org.nd4j.linalg.api.ndarray.INDArray |
activate(boolean training)
Trigger an activation with the last specified input
|
org.nd4j.linalg.primitives.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
|
double |
calcL1(boolean backpropParamsOnly)
Calculate the l1 regularization term
0.0 if regularization is not used. |
double |
calcL2(boolean backpropParamsOnly)
Calculate the l2 regularization term
0.0 if regularization is not used. |
void |
clearNoiseWeightParams() |
Layer |
clone()
Clone the layer
|
void |
computeGradientAndScore()
Update the score
|
void |
fit()
All models have a fit method
|
void |
fit(org.nd4j.linalg.api.ndarray.INDArray input)
Fit the model to the given data
|
org.nd4j.linalg.api.ndarray.INDArray |
getParam(String param)
Get the parameter
|
protected int |
getSize() |
Gradient |
gradient()
Get the gradient.
|
boolean |
isPretrainLayer()
Returns true if the layer can be trained in an unsupervised/pretrain manner (AE, VAE, etc)
|
void |
iterate(org.nd4j.linalg.api.ndarray.INDArray input)
iterate one iteration of the network
|
int |
numParams()
The number of parameters for the model
|
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) |
org.nd4j.linalg.api.ndarray.INDArray |
preOutput(boolean training,
boolean forBackprop) |
double |
score()
The score for the model
|
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
|
void |
update(org.nd4j.linalg.api.ndarray.INDArray gradient,
String paramType)
Perform one update applying the gradient
|
activate, activate, activate, activate, activate, addListeners, applyConstraints, applyDropOutIfNecessary, applyMask, batchSize, clear, conf, feedForwardMaskArray, getGradientsViewArray, getIndex, getInput, getInputMiniBatchSize, getListeners, getMaskArray, getOptimizer, gradientAndScore, init, initParams, input, layerConf, layerId, migrateInput, numParams, paramTable, paramTable, preOutput, preOutput, preOutput, setBackpropGradientsViewArray, setCacheMode, setConf, setIndex, setInput, setInputMiniBatchSize, setListeners, setListeners, setMaskArray, setParam, setParams, setParamsViewArray, setParamTable, update, validateInput
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEpochCount, getIterationCount, setEpochCount, setIterationCount
public Upsampling2D(NeuralNetConfiguration conf)
public Upsampling2D(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.INDArray input)
public double calcL2(boolean backpropParamsOnly)
Layer
calcL2
in interface Layer
calcL2
in class AbstractLayer<Upsampling2D>
backpropParamsOnly
- If true: calculate L2 based on backprop params only. If false: calculate
based on all params (including pretrain params, if any)public double calcL1(boolean backpropParamsOnly)
Layer
calcL1
in interface Layer
calcL1
in class AbstractLayer<Upsampling2D>
backpropParamsOnly
- If true: calculate L1 based on backprop params only. If false: calculate
based on all params (including pretrain params, if any)public Layer.Type type()
Layer
type
in interface Layer
type
in class AbstractLayer<Upsampling2D>
public org.nd4j.linalg.primitives.Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray> backpropGradient(org.nd4j.linalg.api.ndarray.INDArray epsilon)
Layer
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.protected int getSize()
public org.nd4j.linalg.api.ndarray.INDArray preOutput(boolean training)
preOutput
in class AbstractLayer<Upsampling2D>
public org.nd4j.linalg.api.ndarray.INDArray preOutput(boolean training, boolean forBackprop)
public org.nd4j.linalg.api.ndarray.INDArray activate(boolean training)
Layer
training
- training or test modepublic Layer transpose()
Layer
transpose
in interface Layer
transpose
in class AbstractLayer<Upsampling2D>
public Layer clone()
Layer
clone
in interface Layer
clone
in class AbstractLayer<Upsampling2D>
public boolean isPretrainLayer()
Layer
public void clearNoiseWeightParams()
public void iterate(org.nd4j.linalg.api.ndarray.INDArray input)
AbstractLayer
iterate
in interface Model
iterate
in class AbstractLayer<Upsampling2D>
input
- the input to iterate onpublic Gradient gradient()
Model
Model.computeGradientAndScore()
.gradient
in interface Model
gradient
in class AbstractLayer<Upsampling2D>
public void fit()
Model
fit
in interface Model
fit
in class AbstractLayer<Upsampling2D>
public int numParams()
AbstractLayer
numParams
in interface Model
numParams
in class AbstractLayer<Upsampling2D>
public void fit(org.nd4j.linalg.api.ndarray.INDArray input)
Model
fit
in interface Model
fit
in class AbstractLayer<Upsampling2D>
input
- the data to fit the model topublic void computeGradientAndScore()
Model
computeGradientAndScore
in interface Model
computeGradientAndScore
in class AbstractLayer<Upsampling2D>
public double score()
Model
score
in interface Model
score
in class AbstractLayer<Upsampling2D>
public void accumulateScore(double accum)
Model
accumulateScore
in interface Model
accumulateScore
in class AbstractLayer<Upsampling2D>
accum
- the amount to accumpublic void update(org.nd4j.linalg.api.ndarray.INDArray gradient, String paramType)
Model
update
in interface Model
update
in class AbstractLayer<Upsampling2D>
gradient
- the gradient to applypublic org.nd4j.linalg.api.ndarray.INDArray params()
AbstractLayer
params
in interface Model
params
in class AbstractLayer<Upsampling2D>
public org.nd4j.linalg.api.ndarray.INDArray getParam(String param)
Model
getParam
in interface Model
getParam
in class AbstractLayer<Upsampling2D>
param
- the key of the parameterpublic void setParams(org.nd4j.linalg.api.ndarray.INDArray params)
Model
setParams
in interface Model
setParams
in class AbstractLayer<Upsampling2D>
params
- the parameters for the modelCopyright © 2018. All rights reserved.