Contributing: Algorithm¶
Algorithms live in plugrl-server.
Where to edit¶
- Implementation:
plugrl_server/algorithm/... - Registration:
plugrl_server.algorithm.registration - Server loop:
plugrl_server.server.websocket_agent_server
Checklist¶
- Implement the
infer(...)andfeedback(...)contract used by the server loop. - Decide
on_policy. Keep the defaultTrueif each learn step may use only frames the current policy collected. SetFalseif the algorithm learns from a replay buffer. - If you override
discard_feedback, callsuper()so finished episodes are still recorded. - Implement training and checkpoint hooks as needed.
- Register your config (UID + variants) and your class, and make sure both modules are imported.
Verify¶
Start a server that uses your algorithm.
Connect a dummy worker.
Troubleshooting¶
- Algo UID not listed under
plugrl-run-server <policy> <variant> --help: registration module was not imported. KeyError: 'Algorithm <your-algo> is not registered.': the config module was imported, the class module was not.- Server crashes on first
infer: observation schema mismatch.