-
Notifications
You must be signed in to change notification settings - Fork 0
Development
Install the locked development environment:
uv syncRun the quality checks used by the repository:
uvx ruff check .
uvx ruff format --check .
uv buildThere is currently no test suite. For behavior changes, also run a short, relevant experiment and inspect its log and MLflow metrics.
- Use Python 3.12 typing, four-space indentation, and a 100-character line limit.
- Use
snake_casefor modules, functions, config keys, and registry names,PascalCasefor classes, andUPPER_CASEfor registries and constants. - Keep orchestration in
app/, reusable construction and validation incore/, and domain code in its matching package. - Prefer typed, validated dataclass configuration over unstructured parameter access inside components.
- Preserve seed handling, resolved configs, and checkpoint compatibility when changing experiment behavior.
Environment backends, agents, policies, and network nodes share the same extension workflow:
- define a class that inherits the matching base class
- define its typed nested or module-level
Configdataclass - validate values in
Config.__post_init__when needed - register the class with the matching decorator
- add its module to the builder's module list so registration occurs
- add a focused Hydra config when users need to select it
- document its compatibility and behavior.
A minimal stateless network node looks like:
@register_node("example")
class ExampleNode(BaseNode):
@dataclasses.dataclass(kw_only=True, slots=True)
class Config(BaseNode.Config):
scale: float = 1.0
@property
def output_shape(self) -> TensorShape:
return self.input_shape
def forward(self, inputs, state=None):
return inputs * self._cfg.scale, NoneStateful nodes must also implement initial_state and reset_state. Their forward method must be deterministic for identical parameters, input, and state, and must not mutate the supplied state or module buffers.
Add reusable settings to the narrowest group under src/spiking_rl_lab/configs/. Do not grow the root config.yaml with component-specific parameters.
Add a file under configs/experiment/ when a complete training setup must be retained. Such a file should include the environment, agent and network, runner, and trainer values that affect results.
Verify composition before execution:
uv run spiking-rl-lab experiment=<name> --cfg jobThe project wiki is maintained in a separate Git repository.
- Keep
README.mdas the short project entry point. - Update the relevant wiki page when configuration, architecture, algorithms, commands, or supported components change.
- Keep
Algorithms.mdas an index and document each learning algorithm inAlgorithms/<Algorithm>.md, including its objective and spiking-state behavior. - Add a page only when the topic cannot fit clearly into an existing one.
- Link pages from
_Sidebar.mdand avoid copying the same reference material into several pages.