diff options
| author | YurenHao0426 <Blackhao0426@gmail.com> | 2026-07-22 05:44:14 -0500 |
|---|---|---|
| committer | YurenHao0426 <Blackhao0426@gmail.com> | 2026-07-22 05:44:14 -0500 |
| commit | c3709dc0dead3234a7423ae705da9703e4d52f68 (patch) | |
| tree | 36f7c579b9732fb7b6d28f2bdd846fcf668f1ca0 /sdil/bci.py | |
| parent | bcd6b1a302d9591b9db0d13c8cd231c6575d160c (diff) | |
bci: add preregistered signature metrics
Diffstat (limited to 'sdil/bci.py')
| -rw-r--r-- | sdil/bci.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sdil/bci.py b/sdil/bci.py index 9847ffe..c8408e3 100644 --- a/sdil/bci.py +++ b/sdil/bci.py @@ -224,7 +224,8 @@ class BCISDIL: error = self.cfg.target - cursor loss = 0.5 * error.square() - did_perturb = global_step % self.cfg.perturb_every == 0 + did_perturb = (learn_vectorizer + and global_step % self.cfg.perturb_every == 0) causal_target = None if did_perturb: causal_target = self.causal_targets( @@ -270,6 +271,11 @@ def run_day(model, trajectories, day, *, control_gain=1.0, success = torch.zeros_like(active) events = [] for step_index in range(cfg.steps_per_episode): + previous_soma_for_record = soma + previous_error_for_record = (torch.full( + (episodes,), abs(cfg.target), device=model.device, dtype=model.dtype) + if previous_abs_error is None + else previous_abs_error) record = model.step( trajectories.context[day, :, step_index], trajectories.process_noise[day, :, step_index], @@ -288,6 +294,8 @@ def run_day(model, trajectories, day, *, control_gain=1.0, } | { "active": active.detach().cpu().clone(), "success": success.detach().cpu().clone(), + "previous_soma": previous_soma_for_record.detach().cpu().clone(), + "previous_abs_error": previous_error_for_record.detach().cpu().clone(), "step": step_index, }) soma = record["soma"] |
