InducedSetAttentionBlock
¶
InducedSetAttentionBlock(
channels: int,
num_induced_points: int,
heads: int = 1,
layer_norm: bool = True,
dropout: float = 0.0,
)
Bases: Module
The Induced Set Attention Block (ISAB) from the "Set Transformer" paper: \(\mathrm{ISAB}(\mathbf{X}) = \mathrm{MAB}(\mathbf{x}, \mathbf{h})\) with \(\mathbf{h} = \mathrm{MAB}(\mathbf{I}, \mathbf{x})\) for learnable induced points \(\mathbf{I}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels
|
int
|
Size of each input sample. |
required |
num_induced_points
|
int
|
Number of induced points. |
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 InducedSetAttentionBlock · mlx_graphs/nn/aggr/utils.py