-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hello,
I’ve been studying the trainer implementation and want to confirm my understanding against the real code and explore possible options.
Current Behavior
- Agent must be a
trace.model(aModule)
TheAlgorithmBase.__init__asserts the passedagentis aModule—no plain functions or callbacks are accepted . - Only single-argument
__call__
MinibatchAlgorithm.forward(and its parent classes) invoke the agent viaagent(x), passing exactly one element from the dataset per call . - No direct callback function support
You cannot hand in a raw Python function or lambda to the trainer; it must be wrapped as atrace.modelclass (or function decorated with@trace.model) to satisfy theModuleinterface.
Questions
-
Function optimization
Must every function I want to train be bundled into atrace.modelclass (or decorated) before passing it to the trainer? -
Custom workflow steps
If I need to bypass or extend the agent’s__call__, is the intended pattern to subclass the algorithm (e.g.MinibatchAlgorithm) and override itsforward()method to call specific agent methods? -
Multiple arguments to the agent
For agents that naturally take more than one input argument, is it better to:- Pack them into a single container (e.g.
dictortuple) and pass that asxso I am limited to 1 parameter functions, - Or subclass the algorithm and override
forward()so it unpacks and passes multiple parameters to the agent directly?
- Pack them into a single container (e.g.
Metadata
Metadata
Assignees
Labels
No labels