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 TypeMethodDescriptionvoidApplies weight changes to current weights Must be diferent for convolutional does nothing for MaxPooling Same for FullyConnected and OutputLayervoidbackward()This method should implement backward pass in subclassesvoidforward()This method should implement forward pass in subclassesvoidinit()This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).voidvoidsetOptimizerType(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:AbstractLayerThis method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).- Specified by:
initin classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-
forward
public void forward()Description copied from class:AbstractLayerThis method should implement forward pass in subclasses- Specified by:
forwardin interfaceLayer<Tensor1D>- Specified by:
forwardin classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-
backward
public void backward()Description copied from class:AbstractLayerThis method should implement backward pass in subclasses- Specified by:
backwardin interfaceLayer<Tensor1D>- Specified by:
backwardin classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-
setOptimizerType
- Overrides:
setOptimizerTypein classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-
applyWeightChanges
public void applyWeightChanges()Description copied from class:AbstractLayerApplies weight changes to current weights Must be diferent for convolutional does nothing for MaxPooling Same for FullyConnected and OutputLayer- Specified by:
applyWeightChangesin classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-
toString
-
initTransientFields
public void initTransientFields()- Overrides:
initTransientFieldsin classAbstractLayer<Tensor1D,Tensor1D, TensorBase>
-