Class FlattenLayer
java.lang.Object
deepnetts.net.layers.AbstractLayer<TensorBase, TensorBase, TensorBase>
deepnetts.net.layers.FlattenLayer
- All Implemented Interfaces:
Backward, Forward, Layer<TensorBase>, 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:
-
Field Summary
Fields inherited from class AbstractLayer
activation, activationType, backwardImpl, batchMode, batchSize, biases, cudaHandles, deltaBiases, deltas, deltaWeights, depth, forwardImpl, gradients, height, inputs, learningRate, mode, momentum, networkType, nextLayer, numThreads, optimizer, optimizerType, outputs, prevDeltaBiases, prevDeltaWeights, prevLayer, randomWeightsType, regL1, regL2, threadPool, trainable, weights, width -
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 AbstractLayer
getActivation, getActivationType, getBackwardAcc, getBatchSize, getBiases, getDeltaBiases, getDeltas, getDeltaWeights, getDepth, getForwardAcc, getGradients, getHeight, getL1Regularization, getL1WeightSum, getL2Regularization, getL2WeightSum, getLearningRate, getMode, getMomentum, getNetworkType, getNextLayer, getNumThreads, getOptimizer, getOptimizerType, getOutputs, getPrevDeltaBiases, getPrevDeltaWeights, getPrevlayer, getWeights, getWidth, isBatchMode, isTrainable, setActivationType, setBatchMode, setBatchSize, setBiases, setCudaHandles, setDeltas, setL1Regularization, setL2Regularization, setLearningRate, setMode, setMomentum, setNetworkType, 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<TensorBase, TensorBase, TensorBase>
-
initTransientFields
public void initTransientFields()- Overrides:
initTransientFieldsin classAbstractLayer<TensorBase, TensorBase, TensorBase>
-
forward
public void forward()Description copied from class:AbstractLayerThis method should implement forward pass in subclasses- Specified by:
forwardin interfaceForward- Specified by:
forwardin interfaceLayer<TensorBase>- Specified by:
forwardin classAbstractLayer<TensorBase, TensorBase, TensorBase>
-
backward
public void backward()Description copied from class:AbstractLayerThis method should implement backward pass in subclasses- Specified by:
backwardin interfaceBackward- Specified by:
backwardin interfaceLayer<TensorBase>- Specified by:
backwardin classAbstractLayer<TensorBase, TensorBase, TensorBase>
-
setOptimizerType
- Overrides:
setOptimizerTypein classAbstractLayer<TensorBase, TensorBase, 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<TensorBase, TensorBase, TensorBase>
-
toString
-