feature(zms): add new league middlewares and other models and tools. #458
Open
hiha3456 wants to merge 288 commits intoopendilab:mainfrom
Open
feature(zms): add new league middlewares and other models and tools. #458hiha3456 wants to merge 288 commits intoopendilab:mainfrom
hiha3456 wants to merge 288 commits intoopendilab:mainfrom
Conversation
…gine into dev-league-lxl
added 10 commits
August 24, 2022 11:02
…ansitionList, make battle_rolloutor_for_distar run in dict and list cases
PaParaZz1
requested changes
Aug 27, 2022
| self.keep('train_iter', 'last_eval_iter') | ||
|
|
||
|
|
||
| class BattleContext(Context): |
PaParaZz1
requested changes
Sep 14, 2022
| return output | ||
|
|
||
|
|
||
| def scatter_connection_v2(shape, project_embeddings, entity_location, scatter_dim, scatter_type='add'): |
Member
There was a problem hiding this comment.
can we merge v2 to original ScatterConnection
| return x | ||
|
|
||
|
|
||
| def build_activation2(activation): |
Member
There was a problem hiding this comment.
we should merge this function into original version
PaParaZz1
requested changes
Sep 23, 2022
| from ding.framework import Task, Context | ||
| from ding.league.v2 import BaseLeague | ||
| from ding.league.player import PlayerMeta | ||
| from ding.league.v2.base_league import Job |
Member
There was a problem hiding this comment.
on import from 2-level directory, like from ding.league.v2 import BaseLeague, Job
| sleep(1) | ||
| log_every_sec( | ||
| logging.INFO, 600, "[Coordinator {}] running jobs {}".format(task.router.node_id, self._running_jobs) | ||
| ) |
Member
There was a problem hiding this comment.
maybe we should add state_dict/load_state_dict method for coordinator?
| def get_job_info(self, player_id): | ||
| self.get_job_info_cnt += 1 | ||
| other_players = [i for i in self.active_players_ids if i != player_id] | ||
| another_palyer = random.choice(other_players) |
| return unpickler.load() | ||
|
|
||
|
|
||
| def my_pickle_loads(msg): |
Member
There was a problem hiding this comment.
move this function to ding/utils
|
|
||
| @dataclass | ||
| class PlayerModelInfo: | ||
| get_new_model_time: float |
Member
There was a problem hiding this comment.
why two time here, maybe we can simplify them
| # If we don't have Trajectory(t-1), i.e. the length of the whole episode is smaller than unroll_len, | ||
| # we fill up the trajectory with the first element of episode. | ||
| return_episode = [] | ||
| i = 0 |
| initial_elements.append(trajectory[0]) | ||
| trajectory = initial_elements + trajectory | ||
| if self._last_step_fn: | ||
| last_step = deepcopy(trajectory[-1]) |
| task.router.node_id | ||
| ) | ||
|
|
||
| ctx.n_episode = self.cfg.policy.collect.n_episode |
| time_begin = time.time() | ||
| collector(ctx) | ||
|
|
||
| if ctx.job_finish is True: |
| ) | ||
| ) | ||
|
|
||
| gc.collect() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue
TODO
Check List