public class Upsampling2D extends AbstractLayer<Upsampling2D>
Used for upsampling a 2D convolution
Layer.TrainingMode, Layer.Type
cacheMode, conf, dataType, dropoutApplied, epochCount, index, input, inputModificationAllowed, iterationCount, maskArray, maskState, preOutput, trainingListeners
Constructor and Description |
---|
Upsampling2D(NeuralNetConfiguration conf,
DataType dataType) |
Modifier and Type | Method and Description |
---|---|
INDArray |
activate(boolean training,
LayerWorkspaceMgr workspaceMgr)
Perform forward pass and return the activations array with the last set input
|
Pair<Gradient,INDArray> |
backpropGradient(INDArray epsilon,
LayerWorkspaceMgr workspaceMgr)
Calculate the gradient relative to the error in the next layer
|
void |
clearNoiseWeightParams() |
void |
fit()
All models have a fit method
|
void |
fit(INDArray input,
LayerWorkspaceMgr workspaceMgr)
Fit the model to the given data
|
protected CNN2DFormat |
getFormat() |
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)
|
long |
numParams()
The number of parameters for the model
|
INDArray |
params()
Returns the parameters of the neural network as a flattened row vector
|
protected INDArray |
preOutput(boolean training,
boolean forBackprop,
LayerWorkspaceMgr workspaceMgr) |
double |
score()
The score for the model
|
void |
setParams(INDArray params)
Set the parameters for this model.
|
Layer.Type |
type()
Returns the layer type
|
void |
update(INDArray gradient,
String paramType)
Perform one update applying the gradient
|
activate, addListeners, allowInputModification, applyConstraints, applyDropOutIfNecessary, applyMask, assertInputSet, backpropDropOutIfPresent, batchSize, calcRegularizationScore, clear, close, computeGradientAndScore, conf, feedForwardMaskArray, getConfig, getEpochCount, getGradientsViewArray, getHelper, getIndex, getInput, getInputMiniBatchSize, getListeners, getMaskArray, getOptimizer, gradientAndScore, init, input, layerConf, layerId, numParams, paramTable, paramTable, setBackpropGradientsViewArray, setCacheMode, setConf, setEpochCount, setIndex, setInput, setInputMiniBatchSize, setListeners, setListeners, setMaskArray, setParam, setParams, setParamsViewArray, setParamTable, update, updaterDivideByMinibatch
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIterationCount, setIterationCount
public Upsampling2D(NeuralNetConfiguration conf, DataType dataType)
public Layer.Type type()
Layer
type
in interface Layer
type
in class AbstractLayer<Upsampling2D>
public Pair<Gradient,INDArray> backpropGradient(INDArray epsilon, LayerWorkspaceMgr workspaceMgr)
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.workspaceMgr
- Workspace managerArrayType.ACTIVATION_GRAD
workspace via the workspace managerprotected int[] getSize()
protected CNN2DFormat getFormat()
protected INDArray preOutput(boolean training, boolean forBackprop, LayerWorkspaceMgr workspaceMgr)
public INDArray activate(boolean training, LayerWorkspaceMgr workspaceMgr)
Layer
training
- training or test modeworkspaceMgr
- Workspace managerArrayType.ACTIVATIONS
workspace via the workspace managerpublic boolean isPretrainLayer()
Layer
public void clearNoiseWeightParams()
public Gradient gradient()
Model
Model.computeGradientAndScore(LayerWorkspaceMgr)
} .gradient
in interface Model
gradient
in class AbstractLayer<Upsampling2D>
public void fit()
Model
fit
in interface Model
fit
in class AbstractLayer<Upsampling2D>
public long numParams()
AbstractLayer
numParams
in interface Model
numParams
in interface Trainable
numParams
in class AbstractLayer<Upsampling2D>
public void fit(INDArray input, LayerWorkspaceMgr workspaceMgr)
Model
fit
in interface Model
fit
in class AbstractLayer<Upsampling2D>
input
- the data to fit the model topublic double score()
Model
score
in interface Model
score
in class AbstractLayer<Upsampling2D>
public void update(INDArray gradient, String paramType)
Model
update
in interface Model
update
in class AbstractLayer<Upsampling2D>
gradient
- the gradient to applypublic INDArray params()
AbstractLayer
params
in interface Model
params
in interface Trainable
params
in class AbstractLayer<Upsampling2D>
public INDArray getParam(String param)
Model
getParam
in interface Model
getParam
in class AbstractLayer<Upsampling2D>
param
- the key of the parameterpublic void setParams(INDArray params)
Model
setParams
in interface Model
setParams
in class AbstractLayer<Upsampling2D>
params
- the parameters for the modelCopyright © 2020. All rights reserved.