SetAttentionBlock
¶
Bases: Module
The Set Attention Block (SAB) from the "Set Transformer" paper: \(\mathrm{SAB}(\mathbf{X}) = \mathrm{MAB}(\mathbf{x}, \mathbf{y})\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels
|
int
|
Size of each input sample. |
required |
heads
|
int
|
Number of attention heads. Default: |
1
|
layer_norm
|
bool
|
Whether to apply layer normalization. Default: |
True
|
dropout
|
float
|
Dropout probability of the attention weights. Default: |
0.0
|
Source code in mlx_graphs/nn/aggr/utils.py
from mlx_graphs.nn.aggr import SetAttentionBlock · mlx_graphs/nn/aggr/utils.py