Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Fit ES and ARS results dict to rest of RLlib, enable results to be fetched in release tests and and CI learning tests #35588

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions rllib/algorithms/ars/ars.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,16 @@ def step(self):
"episodes_this_iter": noisy_lengths.size,
"episodes_so_far": self.episodes_so_far,
}
result = dict(
episode_reward_mean=np.mean(self.reward_list[-self.report_length :]),
episode_len_mean=eval_lengths.mean(),
timesteps_this_iter=noisy_lengths.sum(),
info=info,
)

reward_mean = np.mean(self.reward_list[-self.report_length :])
result = {
"sampler_results": {
"episode_reward_mean": reward_mean,
"episode_len_mean": eval_lengths.mean(),
},
"timesteps_this_iter": noisy_lengths.sum(),
"info": info,
}

return result

Expand Down
14 changes: 8 additions & 6 deletions rllib/algorithms/es/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,14 @@ def step(self):
}

reward_mean = np.mean(self.reward_list[-self.report_length :])
result = dict(
episode_reward_mean=reward_mean,
episode_len_mean=eval_lengths.mean(),
timesteps_this_iter=noisy_lengths.sum(),
info=info,
)
result = {
"sampler_results": {
"episode_reward_mean": reward_mean,
"episode_len_mean": eval_lengths.mean(),
},
"timesteps_this_iter": noisy_lengths.sum(),
"info": info,
}

return result

Expand Down
2 changes: 1 addition & 1 deletion rllib/tuned_examples/ars/cartpole-ars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cartpole-ars:
env: CartPole-v1
run: ARS
stop:
episode_reward_mean: 150
sampler_results/episode_reward_mean: 150
timesteps_total: 1000000
config:
# Works for both torch and tf.
Expand Down