encoderblock
EncoderBlock
¶
Bases: Module
Source code in spotpython/light/transformer/encoderblock.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
__init__(input_dim, num_heads, dim_feedforward, dropout=0.0)
¶
Initializes the EncoderBlock object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_dim |
int
|
The dimensionality of the input. |
required |
num_heads |
int
|
The number of heads to use in the attention block. |
required |
dim_feedforward |
int
|
The dimensionality of the hidden layer in the MLP. |
required |
dropout |
float
|
The dropout probability to use in the dropout layers. |
0.0
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in spotpython/light/transformer/encoderblock.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|