Package deepnetts.net.layers
Class FlattenLayer
- All Implemented Interfaces:
Layer<Tensor1D>
,Serializable
Transforms outputs from previous 3D layer into a flatten 1D tensor in forward pass,
Backward pass propagates weighted errors/deltas from the next fully connected layer.
Automatically added after 2D or 3D layer to transition to fully connected layers.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies weight changes to current weights Must be diferent for convolutional does nothing for MaxPooling Same for FullyConnected and OutputLayervoid
backward()
This method should implement backward pass in subclassesvoid
forward()
This method should implement forward pass in subclassesvoid
init()
This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).void
void
setOptimizerType
(OptimizerType optType) toString()
Methods inherited from class deepnetts.net.layers.AbstractLayer
getActivation, getActivationType, getBatchSize, getBiases, getDeltaBiases, getDeltas, getDeltaWeights, getDepth, getForwardAccelerator, getGradients, getHeight, getL1Regularization, getL1WeightSum, getL2Regularization, getL2WeightSum, getLearningRate, getMode, getMomentum, getNextLayer, getOptimizer, getOptimizerType, getOutputs, getPrevDeltaBiases, getPrevDeltaWeights, getPrevlayer, getWeights, getWidth, isBatchMode, isTrainable, setBatchMode, setBatchSize, setBiases, setCudaHandles, setDeltas, setL1Regularization, setL2Regularization, setLearningRate, setMode, setMomentum, setNextlayer, setOutputs, setPrevDeltaWeights, setPrevLayer, setThreadPool, setTrainable, setWeights, setWeights
-
Constructor Details
-
FlattenLayer
public FlattenLayer()
-
-
Method Details
-
init
public void init()Description copied from class:AbstractLayer
This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).- Specified by:
init
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-
forward
public void forward()Description copied from class:AbstractLayer
This method should implement forward pass in subclasses- Specified by:
forward
in interfaceLayer<Tensor1D>
- Specified by:
forward
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-
backward
public void backward()Description copied from class:AbstractLayer
This method should implement backward pass in subclasses- Specified by:
backward
in interfaceLayer<Tensor1D>
- Specified by:
backward
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-
setOptimizerType
- Overrides:
setOptimizerType
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-
applyWeightChanges
public void applyWeightChanges()Description copied from class:AbstractLayer
Applies weight changes to current weights Must be diferent for convolutional does nothing for MaxPooling Same for FullyConnected and OutputLayer- Specified by:
applyWeightChanges
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-
toString
-
initTransientFields
public void initTransientFields()- Overrides:
initTransientFields
in classAbstractLayer<Tensor1D,
Tensor1D, TensorBase>
-