The model learns to alternate between visual and auditory stimulus discrimination across block switches, using only reward feedback to infer the current context. No explicit context signal is ever provided as input.
d' is signal detection theory discriminability (d' > 1.5 = reliable discrimination, d' ≈ 4.65 = ceiling).
1import torch
2from huggingface_hub import hf_hub_download
3from dr_gru.models.gru import DynamicRoutingGRU
4
5# Download checkpoint
6ckpt_path = hf_hub_download(
7 repo_id="pavi-rajes/dr-gru-dynamic-routing",
8 filename="checkpoints/seed0_context_learning.pt",
9)
10
11ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)
12model = DynamicRoutingGRU(N=200, n_in=7, n_out=1, sigma_rec=0.05)
13model.load_state_dict(ckpt["model_state_dict"])
14model.eval()
15
16print(f"d'_intra = {ckpt['metrics']['d_prime_intra']:.3f}")
17print(f"d'_inter = {ckpt['metrics']['d_prime_inter']:.3f}")
1git clone https://huggingface.co/pavi-rajes/dr-gru-dynamic-routing
2cd dr-gru-dynamic-routing
3python demo_load_model.py --ckpt checkpoints/seed0_context_learning.pt
All checkpoints are snapshotted at the moment each seed first achieved d'_intra > 1.5 and d'_inter > 1.5 for two consecutive evaluations.
1@misc{dr_gru_2026,
2 author = {Ravi, Pavithra},
3 title = {Dynamic Routing GRU: Context-Dependent Sensory Routing via Reward Feedback},
4 year = {2026},
5 url = {https://huggingface.co/pavi-rajes/dr-gru-dynamic-routing},
6}