MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / build_orders

Method build_orders

trinity/buffer/task_scheduler.py:163–179  ·  view source on GitHub ↗

Creates a shuffled sequence of taskset IDs to control sampling priority per step. At the start of each epoch, all tasksets are shuffled proportionally to their size, ensuring balanced exposure while introducing randomness in selection order. Args: epoch

(self, epoch: int)

Source from the content-addressed store, hash-verified

161 )
162
163 def build_orders(self, epoch: int):
164 """
165 Creates a shuffled sequence of taskset IDs to control sampling priority per step.
166
167 At the start of each epoch, all tasksets are shuffled proportionally to their size,
168 ensuring balanced exposure while introducing randomness in selection order.
169
170 Args:
171 epoch (int): Epoch ID used as seed for deterministic shuffling
172
173 Returns:
174 List[int]: Sequence of taskset IDs, length = steps_per_epoch * batch_size
175 """
176 taskset_ids = self.base_taskset_ids.copy()
177 rng = np.random.default_rng(epoch)
178 rng.shuffle(taskset_ids)
179 return taskset_ids
180
181 def _should_stop(self) -> bool:
182 return self.step >= self.max_steps

Callers 2

__init__Method · 0.95
readMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected