From 7b0c7a87bc15ebdafb8c339458abed024451ee28 Mon Sep 17 00:00:00 2001 From: ysqyang Date: Thu, 24 Sep 2020 00:40:44 -0400 Subject: [PATCH] V0.1 k step key error fix (#84) * fixed a key error in K-step shaper for CIM * fixed key error in k-step shaper in dist_actor Co-authored-by: ysqyang --- examples/cim/dqn/components/dist_actor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/cim/dqn/components/dist_actor.py b/examples/cim/dqn/components/dist_actor.py index 5491c8b3..77d8dc7a 100644 --- a/examples/cim/dqn/components/dist_actor.py +++ b/examples/cim/dqn/components/dist_actor.py @@ -20,7 +20,8 @@ if __name__ == "__main__": if config.experience_shaping.type == "truncated": experience_shaper = TruncatedExperienceShaper(**config.experience_shaping.truncated) else: - experience_shaper = KStepExperienceShaper(reward_func=lambda mt: mt["perf"], **config.experience_shaping.k_step) + experience_shaper = KStepExperienceShaper(reward_func=lambda mt: 1-mt["container_shortage"]/mt["order_requirements"], + **config.experience_shaping.k_step) exploration_config = {"epsilon_range_dict": {"_all_": config.exploration.epsilon_range}, "split_point_dict": {"_all_": config.exploration.split_point},