Minimal reference implementation of LAYA, an interpretable output head that assigns input-conditioned attention weights to hidden layers. This example trains a simple MLP on Fashion-MNIST and visualizes global and class-wise attention profiles.
Click the badge above or open: LAYA.ipynb
The notebook:
- trains LAYA on Fashion-MNIST,
- evaluates accuracy and macro-F1,
- extracts layer-wise attention weights,
- plots global and class-wise attention patterns.
LAYA aggregates all hidden representations ( h_i ) using attention scores ( \alpha_i(x) ), producing:
- depth-aware predictions,
- intrinsic, per-sample interpretability without post-hoc methods.