浏览代码

[🐛 🔨 ]Adding the ELO to the GlobalTrainingStatus (#5202)

* Adding the ELO to the GlobalTrainingStatus

* Update ml-agents/mlagents/trainers/ghost/trainer.py

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>
(cherry picked from commit 9c3dc4542ce2fa35f25dfa7809a7e1c2ee06001e)
/release_16_branch
Ervin Teng 4 年前
当前提交
e1c23ad7
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 11
      ml-agents/mlagents/trainers/ghost/trainer.py
  2. 1
      ml-agents/mlagents/trainers/training_status.py

11
ml-agents/mlagents/trainers/ghost/trainer.py


BehaviorIdentifiers,
create_name_behavior_id,
)
from mlagents.trainers.training_status import GlobalTrainingStatus, StatusType
logger = get_logger(__name__)

self.last_swap: int = 0
self.last_team_change: int = 0
# Chosen because it is the initial ELO in Chess
self.initial_elo: float = self_play_parameters.initial_elo
self.initial_elo = GlobalTrainingStatus.get_parameter_state(
self.brain_name, StatusType.ELO
)
if self.initial_elo is None:
self.initial_elo = self_play_parameters.initial_elo
self.policy_elos: List[float] = [self.initial_elo] * (
self.window + 1
) # for learning policy

"""
Forwarding call to wrapped trainers save_model.
"""
GlobalTrainingStatus.set_parameter_state(
self.brain_name, StatusType.ELO, self.current_elo
)
self.trainer.save_model()
def create_policy(

1
ml-agents/mlagents/trainers/training_status.py


STATS_METADATA = "metadata"
CHECKPOINTS = "checkpoints"
FINAL_CHECKPOINT = "final_checkpoint"
ELO = "elo"
@attr.s(auto_attribs=True)

正在加载...
取消
保存