public static final class BertBlock.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
BertBlock.Builder |
base()
Sets this builder's params to the BASE config of the original BERT paper.
|
BertBlock |
build()
Returns a new BertBlock with the parameters of this builder.
|
BertBlock.Builder |
large()
Sets this builder's params to the LARGE config of the original BERT paper.
|
BertBlock.Builder |
micro()
Sets this builder's params to a minimal configuration that nevertheless performs quite
well.
|
BertBlock.Builder |
nano()
Tiny config for testing on laptops.
|
BertBlock.Builder |
optAttentionHeadCount(int attentionHeadCount)
Sets the number of attention heads to use in each transformer block.
|
BertBlock.Builder |
optEmbeddingSize(int embeddingSize)
Sets the embedding size to use for input tokens.
|
BertBlock.Builder |
optHiddenDropoutProbability(float hiddenDropoutProbability)
Sets the dropout probabilty in the hidden fully connected networks.
|
BertBlock.Builder |
optHiddenSize(int hiddenSize)
Sets the size of the hidden layers in the fully connected networks used.
|
BertBlock.Builder |
optMaxSequenceLength(int maxSequenceLength)
Sets the maximum sequence length this model can process.
|
BertBlock.Builder |
optTransformerBlockCount(int transformerBlockCount)
Sets the number of transformer blocks to use.
|
BertBlock.Builder |
optTypeDictionarySize(int typeDictionarySize)
Sets the number of possible token types.
|
BertBlock.Builder |
setTokenDictionarySize(int tokenDictionarySize)
Sets the number of tokens in the dictionary.
|
public BertBlock.Builder setTokenDictionarySize(int tokenDictionarySize)
tokenDictionarySize
- the number of tokens in the dictionarypublic BertBlock.Builder optTypeDictionarySize(int typeDictionarySize)
typeDictionarySize
- the number of possible token types. This should be a very small
number (2-16)public BertBlock.Builder optEmbeddingSize(int embeddingSize)
embeddingSize
- the embedding size to use for input tokens.public BertBlock.Builder optTransformerBlockCount(int transformerBlockCount)
transformerBlockCount
- the number of transformer blocks to usepublic BertBlock.Builder optAttentionHeadCount(int attentionHeadCount)
attentionHeadCount
- the number of attention heads to use in each transformer block.public BertBlock.Builder optHiddenSize(int hiddenSize)
hiddenSize
- the size of the hidden layers in the fully connected networks used.public BertBlock.Builder optHiddenDropoutProbability(float hiddenDropoutProbability)
hiddenDropoutProbability
- the dropout probabilty in the hidden fully connected
networks.public BertBlock.Builder optMaxSequenceLength(int maxSequenceLength)
maxSequenceLength
- the maximum sequence length this model can process.public BertBlock.Builder nano()
public BertBlock.Builder micro()
public BertBlock.Builder base()
public BertBlock.Builder large()
public BertBlock build()