Attention(in_channels)
Bases: Module
Attention mechanism for feature aggregation.
| Parameters: |
|
|---|
Notes
- Implements learnable attention weights
- Uses softmax normalization
- Includes dropout regularization
- Single-head attention mechanism
forward(inputs)
Apply attention mechanism to input features.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Process:
- Stack input tensors
- Compute attention weights
- Apply softmax normalization
- Weighted sum of features