Skip to content

feat(ocl): add Riemannian Walk (RWalk) strategy - #407

Open
tachyonicClock wants to merge 1 commit into
feat/ocl-masfrom
feat/ocl-rwalk
Open

feat(ocl): add Riemannian Walk (RWalk) strategy#407
tachyonicClock wants to merge 1 commit into
feat/ocl-masfrom
feat/ocl-rwalk

Conversation

@tachyonicClock

@tachyonicClock tachyonicClock commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Stacked on feat(ocl): add Memory Aware Synapses (MAS) strategy #406 (feat/ocl-mas), feat(ocl): add Learning Without Forgetting (LWF) strategy #404 (feat/ocl-lwf), and feat(ocl): add Synaptic Intelligence (SI) strategy #403 (feat/ocl-si) - this PR only diffs the RWalk-specific changes and depends on the earlier PRs for capymoa.ocl.util._optim.reset_optimizer_state and capymoa.ocl.util._buffer_list.BufferList.
  • Cherry-picks the Riemannian Walk (RWalk) continual learning strategy from the blurry-ocl draft branch, adapting it to the current capymoa.ocl module layout.
  • Inlines trainable_params/weighted_l2_reg instead of importing them from _ewc, for the same reason as MAS: the draft's _ewc.py had since diverged from what actually shipped, and this keeps RWalk self-contained like EWC, SI, and MAS.
  • Drops the draft's leading-underscore module function names (_rwalk_update_importances, _copy_params_, etc.) in favour of the no-leading-underscore/trailing-underscore-for-in-place convention SI and MAS already use in this stack.
  • Adds a proper class docstring with a citation, and documents __init__ parameters, matching EWC/SI/MAS's docstring conventions.
  • Renames on_train_task/on_test_task to _on_train_task_begin/_on_test_task_begin and has attach_with return self, for consistency with SI, LWF, and MAS.
  • Registers RWalk in capymoa.ocl.strategy.__init__.
  • Adds masked and unmasked RWalk cases to tests/ocl/test_strategy.py.

Closes adaptive-machine-learning/backlog#125

Assisted-by: claude-code:claude-sonnet-5

RWalk is a regularisation-based continual learning strategy that, like
EWC, augments the task loss with a weighted quadratic penalty on
parameter changes. The penalty weights combine an exponential moving
average of squared gradients with trajectory scores that estimate how
sensitive the loss is to parameter updates, accumulated online between
periodic checkpoints (Chaudhry et al., 2018).

Ported from the `blurry-ocl` draft branch and adapted to the current
`capymoa.ocl` module layout. Also:

* Inlines `trainable_params`/`weighted_l2_reg` instead of importing
  them from `_ewc`, for the same reason as MAS: the draft's `_ewc.py`
  had since diverged from what actually shipped, and this keeps RWalk
  self-contained like EWC, SI, and MAS.
* Drops the draft's leading-underscore module function names
  (`_rwalk_update_importances`, `_copy_params_`, etc.) in favour of the
  no-leading-underscore/trailing-underscore-for-in-place convention SI
  and MAS already use in this stack.
* Adds a proper class docstring with a citation, and documents
  `__init__` parameters, matching EWC/SI/MAS's docstring conventions.
* Renames `on_train_task`/`on_test_task` to `_on_train_task_begin`/
  `_on_test_task_begin` and has `attach_with` return `self`, for
  consistency with SI, LWF, and MAS.

Stacked on `feat/ocl-mas` (#406), which is in turn stacked on
`feat/ocl-lwf` (#404) and `feat/ocl-si` (#403); this PR depends on all
three for `capymoa.ocl.util._optim.reset_optimizer_state` and
`capymoa.ocl.util._buffer_list.BufferList`.

Assisted-by: claude-code:claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant