Collector
Search from a prompt and prepare training data. A Collector combines an agent, a critic, a search strategy, and an actor recipe; collect() returns a Batch of actor and critic samples.
Collector
Section titled “Collector”Search from a prompt and prepare training data. A collector combines an agent, a critic, a search strategy, and an actor recipe. collect() returns a Batch; search() and prepare() split the two stages when you want the tree.
The search has a 16-transition warm-up followed by a 32-transition selective phase. The constant critic gives every state the same starting prediction. Preparation computes direct-branch backups and refined values; DirectBranchTd uses those values for actor advantages. Critic targets come from the backups and stay the same when you change the actor recipe. Leaving the async with block closes the agent’s execution services. The caller owns policy clients and critics, which can be shared across collectors.
Definition
Collector.init
Section titled “Collector.init”Collector.aenter
Section titled “Collector.aenter”Collector.aexit
Section titled “Collector.aexit”Collector.aclose
Section titled “Collector.aclose”Close the agent’s execution services.
Collector.collect
Section titled “Collector.collect”Search from prompt and prepare a Batch with the collector’s estimator. Pass a workspace for task-local state, or an existing rollout checkpoint as prompt. Inspect batch.stats and batch.failures before training: a partial collection still returns its successful records.
Collector.prepare
Section titled “Collector.prepare”Prepare a Batch from a searched tree. Pass estimator= to apply another recipe to the same evidence, or estimator=None for critic targets only.
Collector.search
Section titled “Collector.search”Search from prompt and return the tree. When a critic is supplied, score new checkpoints before ranking them.
The searched rollout tree: every checkpoint, its children, its critic prediction, and the collection statistics. Collector.search() returns it and Collector.prepare() reads it.
Definition