Class SelfAttentionLayer.Builder
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder<SelfAttentionLayer.Builder>
-
- org.deeplearning4j.nn.conf.layers.SelfAttentionLayer.Builder
-
- Enclosing class:
- SelfAttentionLayer
public static class SelfAttentionLayer.Builder extends SameDiffLayer.Builder<SelfAttentionLayer.Builder>
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder
paramWeightInit, weightInit
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder
biasUpdater, regularization, regularizationBias, updater
-
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 SelfAttentionLayerbuild()SelfAttentionLayer.BuilderheadSize(int headSize)Size of attention headsSelfAttentionLayer.BuildernHeads(int nHeads)Number of Attention HeadsSelfAttentionLayer.BuildernIn(int nIn)SelfAttentionLayer.BuildernOut(int nOut)SelfAttentionLayer.BuilderprojectInput(boolean projectInput)Project input before applying attention or not.-
Methods inherited from class org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder
weightInit, weightInit
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder
biasUpdater, l1, l1Bias, l2, l2Bias, regularization, regularizationBias, updater, weightDecay, weightDecay, weightDecayBias, weightDecayBias
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
-
-
-
-
Method Detail
-
nIn
public SelfAttentionLayer.Builder nIn(int nIn)
- Parameters:
nIn- Number of inputs to the layer (input size)
-
nOut
public SelfAttentionLayer.Builder nOut(int nOut)
- Parameters:
nOut- Number of outputs (output size)
-
nHeads
public SelfAttentionLayer.Builder nHeads(int nHeads)
Number of Attention Heads
-
headSize
public SelfAttentionLayer.Builder headSize(int headSize)
Size of attention heads
-
projectInput
public SelfAttentionLayer.Builder projectInput(boolean projectInput)
Project input before applying attention or not.
-
build
public SelfAttentionLayer build()
- Specified by:
buildin classLayer.Builder<SelfAttentionLayer.Builder>
-
-