Class EmbeddingLayer.Builder
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.BaseLayer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder<EmbeddingLayer.Builder>
-
- org.deeplearning4j.nn.conf.layers.EmbeddingLayer.Builder
-
- Enclosing class:
- EmbeddingLayer
public static class EmbeddingLayer.Builder extends FeedForwardLayer.Builder<EmbeddingLayer.Builder>
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder
nIn, nOut
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.BaseLayer.Builder
activationFn, biasInit, biasUpdater, gainInit, gradientNormalization, gradientNormalizationThreshold, iupdater, regularization, regularizationBias, weightInitFn, weightNoise
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmbeddingLayer
build()
EmbeddingLayer.Builder
hasBias(boolean hasBias)
If true: include bias parameters in the layer.EmbeddingLayer.Builder
weightInit(EmbeddingInitializer embeddingInitializer)
Initialize the embedding layer using the specified EmbeddingInitializer - such as a Word2Vec instanceEmbeddingLayer.Builder
weightInit(IWeightInit weightInit)
Weight initialization scheme to use, for initial weight valuesEmbeddingLayer.Builder
weightInit(INDArray vectors)
Initialize the embedding layer using values from the specified array.-
Methods inherited from class org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder
nIn, nIn, nOut, nOut, units
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.BaseLayer.Builder
activation, activation, biasInit, biasUpdater, dist, gainInit, gradientNormalization, gradientNormalizationThreshold, l1, l1Bias, l2, l2Bias, regularization, regularizationBias, updater, updater, weightDecay, weightDecay, weightDecayBias, weightDecayBias, weightInit, weightInit, weightNoise
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
-
-
-
-
Method Detail
-
hasBias
public EmbeddingLayer.Builder hasBias(boolean hasBias)
If true: include bias parameters in the layer. False (default): no bias.- Parameters:
hasBias
- If true: include bias parameters in this layer
-
weightInit
public EmbeddingLayer.Builder weightInit(IWeightInit weightInit)
Description copied from class:BaseLayer.Builder
Weight initialization scheme to use, for initial weight values- Overrides:
weightInit
in classBaseLayer.Builder<EmbeddingLayer.Builder>
- See Also:
IWeightInit
-
weightInit
public EmbeddingLayer.Builder weightInit(EmbeddingInitializer embeddingInitializer)
Initialize the embedding layer using the specified EmbeddingInitializer - such as a Word2Vec instance- Parameters:
embeddingInitializer
- Source of the embedding layer weights
-
weightInit
public EmbeddingLayer.Builder weightInit(INDArray vectors)
Initialize the embedding layer using values from the specified array. Note that the array should have shape [vocabSize, vectorSize]. After copying values from the array to initialize the network parameters, the input array will be discarded (so that, if necessary, it can be garbage collected)- Parameters:
vectors
- Vectors to initialize the embedding layer with
-
build
public EmbeddingLayer build()
- Specified by:
build
in classLayer.Builder<EmbeddingLayer.Builder>
-
-