public static class LearnedSelfAttentionLayer.Builder extends SameDiffLayer.Builder<LearnedSelfAttentionLayer.Builder>
paramWeightInit, weightInit
biasUpdater, regularization, regularizationBias, updater
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
LearnedSelfAttentionLayer |
build() |
LearnedSelfAttentionLayer.Builder |
headSize(int headSize)
Size of attention heads
|
LearnedSelfAttentionLayer.Builder |
nHeads(int nHeads)
Number of Attention Heads
|
LearnedSelfAttentionLayer.Builder |
nIn(int nIn) |
LearnedSelfAttentionLayer.Builder |
nOut(int nOut) |
LearnedSelfAttentionLayer.Builder |
nQueries(int nQueries)
Number of queries to learn
|
LearnedSelfAttentionLayer.Builder |
projectInput(boolean projectInput)
Project input before applying attention or not.
|
weightInit, weightInit
biasUpdater, l1, l1Bias, l2, l2Bias, regularization, regularizationBias, updater, weightDecay, weightDecay, weightDecayBias, weightDecayBias
constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
public LearnedSelfAttentionLayer.Builder nIn(int nIn)
nIn
- Number of inputs to the layer (input size)public LearnedSelfAttentionLayer.Builder nOut(int nOut)
nOut
- Number of outputs (output size)public LearnedSelfAttentionLayer.Builder nHeads(int nHeads)
public LearnedSelfAttentionLayer.Builder headSize(int headSize)
public LearnedSelfAttentionLayer.Builder projectInput(boolean projectInput)
public LearnedSelfAttentionLayer.Builder nQueries(int nQueries)
public LearnedSelfAttentionLayer build()
build
in class Layer.Builder<LearnedSelfAttentionLayer.Builder>
Copyright © 2022. All rights reserved.