Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b152169
Update init files
cpaniaguam May 6, 2026
c3a09be
Add registry
cpaniaguam May 6, 2026
e4fb4ac
Update rlssm module
cpaniaguam May 6, 2026
9dc18ac
Add tests for simplified RLSSM interface and model registration
cpaniaguam May 6, 2026
413fe36
Fix condition in RLSSM class to handle model configuration correctly
cpaniaguam May 6, 2026
19a39aa
Implement lazy loading for SSM base log-likelihood functions and add …
cpaniaguam May 6, 2026
301cd13
Enhance error handling and validation in RLSSM and SSM registry
cpaniaguam May 6, 2026
b23c8c2
Refactor RLSSM model configuration to respect explicit empty containe…
cpaniaguam May 6, 2026
78bd5c5
Add validation to prevent registration of SSM functions with non-empt…
cpaniaguam May 6, 2026
00638ca
Refactor SSM registry to convert parameters to appropriate types for …
cpaniaguam May 7, 2026
101444e
Update error message in get_rlssm_model_config to clarify custom mode…
cpaniaguam May 7, 2026
91b2572
Use more transparent terminology
cpaniaguam May 7, 2026
c82db43
Implement defensive copying for decision process specifications in RL…
cpaniaguam May 8, 2026
9310e88
Refactor SSM registry documentation and enhance SSM base log-likeliho…
cpaniaguam May 8, 2026
5b5b380
Add unit tests for RL registry helpers to validate model registration…
cpaniaguam May 8, 2026
486076b
Move rl-related tests to rl directory
cpaniaguam May 8, 2026
e29e731
Add extra tests to increase test coverage
cpaniaguam May 8, 2026
d12594f
Update RLSSM registry to include 2AB Rescorla-Wagner model
cpaniaguam May 11, 2026
215f50f
Remove redundant classproperty decorator
cpaniaguam May 11, 2026
434a27c
Add list_models to public API documentation in __init__.py
cpaniaguam May 11, 2026
a3d910b
Add 2AB Rescorla-Wagner models to RLSSM registry and implement list_m…
cpaniaguam May 11, 2026
10cd59e
Update RLSSM model default and add classproperty for listing models
cpaniaguam May 11, 2026
a34a766
Update RLSSM tests to validate 2AB Rescorla-Wagner model instantiatio…
cpaniaguam May 11, 2026
d8c9359
Raise error for missing SSM bounds in get_rlssm_model_config to preve…
cpaniaguam May 12, 2026
f99a533
Clarify documentation for RLSSM registry and update example usage for…
cpaniaguam May 12, 2026
918548c
Update model check in RLSSM constructor to use specific model name fo…
cpaniaguam May 12, 2026
1a1cd24
Merge branch 'main' into cpaniaguam/rlssm-simplified-interface
cpaniaguam May 13, 2026
3626f4d
fix: ensure defensive copying of learning process and choices in RLSS…
cpaniaguam May 14, 2026
f3a94d6
fix: update choices assertion to use tuple format in test_builtin_2ab…
cpaniaguam May 14, 2026
54cebfe
chore: remove unnecessary comments
cpaniaguam May 15, 2026
08ba693
refactor: clean up test_rlssm.py by removing unnecessary comments and…
cpaniaguam May 15, 2026
1e987d5
Improve model_config handling in RLSSM class
cpaniaguam May 15, 2026
80d3c98
fix: update logger initialization to use module name for better context
cpaniaguam May 15, 2026
abd86dc
fix: simplify parameter default calculation in _build_ssm_spec_from_m…
cpaniaguam May 15, 2026
aac4f6f
fix: optimize SSM logp retrieval by caching and restructuring conditi…
cpaniaguam May 15, 2026
1042c70
fix: streamline parameter filtering in get_rlssm_model_config by usin…
cpaniaguam May 15, 2026
5320621
fix: enhance RLSSM registry tests with improved error handling and ca…
cpaniaguam May 15, 2026
bc9c88f
fix: rename _derive_rl_params to _derive_lp_params
cpaniaguam May 21, 2026
b47d9db
Rename rl_params to learning_process_params
cpaniaguam May 21, 2026
4973e8a
Fix line too long
cpaniaguam May 21, 2026
52d5fd6
Rename rl_bounds to learning_process_bounds
cpaniaguam May 21, 2026
fe0be81
Rename rl_params_default to learning_process_params_default
cpaniaguam May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/hssm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .param import UserParam as Param
from .prior import Prior
from .register import register_model
from .rl import RLSSM
from .rl import RLSSM, register_rlssm_model
from .simulator import simulate_data
from .utils import check_data_for_rl, set_floatX

Expand All @@ -40,6 +40,7 @@
"Prior",
"check_data_for_rl",
"register_model",
"register_rlssm_model",
"simulate_data",
"set_floatX",
"show_defaults",
Expand Down
28 changes: 0 additions & 28 deletions src/hssm/hssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,6 @@
}


class classproperty:
"""A decorator that combines the behavior of @property and @classmethod.

This decorator allows you to define a property that can be accessed on the class
itself, rather than on instances of the class. It is useful for defining class-level
properties that need to perform some computation or access class-level data.

This implementation is provided for compatibility with Python versions 3.10 through
3.12, as one cannot combine the @property and @classmethod decorators is across all
these versions.

Example
-------
class MyClass:
@classproperty
def my_class_property(cls):
return "This is a class property"

print(MyClass.my_class_property) # Output: This is a class property
"""

def __init__(self, fget):
self.fget = fget

def __get__(self, instance, owner): # noqa: D105
return self.fget(owner)


class HSSM(HSSMBase):
"""The basic Hierarchical Sequential Sampling Model (HSSM) class.

Expand Down
20 changes: 16 additions & 4 deletions src/hssm/rl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

Public API (import from ``hssm.rl``):

- ``RLSSM``: the RL + SSM model class implemented in :mod:`hssm.rl.rlssm`.
- ``RLSSMConfig``: the config class for RL + SSM models, implemented in
:mod:`hssm.rl.config`.
- ``RLSSM``: the public RL + SSM model class in :mod:`hssm.rl.rlssm`.
- ``_RLSSM``: the internal base class that requires a fully built config.
- ``RLSSMConfig``: the config class for RL + SSM models in :mod:`hssm.rl.config`.
- ``get_rlssm_model_config``: factory that builds a config from a named model.
- ``register_rlssm_model``: register a custom named RLSSM model.
- ``register_ssm``: register a custom SSM base logp function.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would we want/need a register_learning_process equivalent here? ( @krishnbera )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we should have a way of registering the learning process separately.

- ``validate_balanced_panel``: panel-balance utility in :mod:`hssm.rl.utils`.

RL likelihood builders live in :mod:`hssm.rl.likelihoods.builder` and include
Expand All @@ -17,11 +20,20 @@
"""

from .config import RLSSMConfig
from .rlssm import RLSSM
from .registry import (
get_rlssm_model_config,
register_rlssm_model,
register_ssm,
)
from .rlssm import _RLSSM, RLSSM
from .utils import validate_balanced_panel

__all__ = [
"RLSSM",
"_RLSSM",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name "_RLSSM" suggests that this class is "private" and should not directly be accessed by the user, so it should not be exposed in __all__

"RLSSMConfig",
"get_rlssm_model_config",
"register_rlssm_model",
"register_ssm",
"validate_balanced_panel",
]
Loading