Class FlatEmbeddingLayer
java.lang.Object
deepnetts.net.layers.AbstractLayer<TensorBase, TensorBase, Tensor2D>
deepnetts.net.layers.FlatEmbeddingLayer
- All Implemented Interfaces:
Backward, Forward, Layer<TensorBase>, Serializable
- 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 subclassesintintvoidinit()This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).voidvoidsetEmbeddingDim(int embeddingDim) voidsetVocabSize(int vocabSize) 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, setOptimizerType, setOutputs, setPrevDeltaWeights, setPrevLayer, setThreadPool, setTrainable, setWeights, setWeights
-
Constructor Details
-
FlatEmbeddingLayer
public FlatEmbeddingLayer(int vocabSize, int embeddingDim)
-
-
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, Tensor2D>
-
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, Tensor2D>
-
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, Tensor2D>
-
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, Tensor2D>
-
initTransientFields
public void initTransientFields()- Overrides:
initTransientFieldsin classAbstractLayer<TensorBase, TensorBase, Tensor2D>
-
setVocabSize
public void setVocabSize(int vocabSize) -
setEmbeddingDim
public void setEmbeddingDim(int embeddingDim) -
getVocabSize
public int getVocabSize() -
getEmbeddingDim
public int getEmbeddingDim() -
toString
-