The timeline of the exploration process: | <--------------------------------- one period -------------------------------------> | explorer | <---------------- step_1 --------------> | | | | <--------------
(self)
| 282 | return self.state_dict[name] |
| 283 | |
| 284 | async def explore(self) -> str: |
| 285 | """ |
| 286 | The timeline of the exploration process: |
| 287 | | <--------------------------------- one period -------------------------------------> | |
| 288 | explorer | <---------------- step_1 --------------> | | |
| 289 | | | <---------------- step_2 --------------> | | |
| 290 | | ... | |
| 291 | | | <---------------- step_n ---------------> | | |
| 292 | | | <---------------------- eval --------------------> | <-- sync --> | |
| 293 | |--------------------------------------------------------------------------------------| |
| 294 | trainer | <-- idle --> | <-- step_1 --> | <-- step_2 --> | ... | <-- step_n --> | <-- sync --> | |
| 295 | """ |
| 296 | while True: |
| 297 | try: |
| 298 | self.logger.info(f"Explore step {self.explore_step_num + 1} started.") |
| 299 | explore_contionue = await self.explore_step() |
| 300 | if not explore_contionue: |
| 301 | # TODO: support eval on last checkpoint |
| 302 | break |
| 303 | if self.need_eval(): |
| 304 | await self.eval() |
| 305 | if await self.need_sync(): |
| 306 | await self.sync_weight() |
| 307 | except Exception: |
| 308 | self.logger.error(f"Error in Explorer: {traceback.format_exc()}") |
| 309 | break |
| 310 | self.logger.info( |
| 311 | f"--------------------\n> Explorer ({self.config.explorer.name}) finished.\n--------------------" |
| 312 | ) |
| 313 | return self.config.explorer.name |
| 314 | |
| 315 | async def explore_step(self) -> bool: |
| 316 | if self.explore_start_time is None: |
nothing calls this directly
no test coverage detected