From c44fd26458496200a3609d91fd06e3195234e366 Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Fri, 3 Apr 2020 19:11:43 +0530 Subject: [PATCH 1/4] Removing terminal state for Pendulum-v0 env --- .../methods/reinforcement_learning/environment/pendulum.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp index 55c02668cd..31ac5f1957 100644 --- a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +++ b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp @@ -222,12 +222,6 @@ class Pendulum "being taken."; return true; } - else if (state.Theta() > M_PI - angleThreshold || - state.Theta() < -M_PI + angleThreshold) - { - Log::Info << "Episode terminated due to agent succeeding."; - return true; - } return false; } From 67322b791b82fbc415281e86820b1c42fcd276d1 Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Mon, 6 Apr 2020 20:09:53 +0530 Subject: [PATCH 2/4] Update pendulum.hpp --- .../methods/reinforcement_learning/environment/pendulum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp index 31ac5f1957..402a77aedb 100644 --- a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +++ b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp @@ -105,7 +105,7 @@ class Pendulum const double dt = 0.05, const double angleThreshold = M_PI / 12, const double doneReward = 0.0, - const size_t maxSteps = 0) : + const size_t maxSteps = 200) : maxAngularVelocity(maxAngularVelocity), maxTorque(maxTorque), dt(dt), From 88fc2e44549aa9afd02a2261969a401282fd4093 Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Wed, 8 Apr 2020 00:18:37 +0530 Subject: [PATCH 3/4] Updated comment for maxSteps --- .../methods/reinforcement_learning/environment/pendulum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp index 402a77aedb..770e4ee020 100644 --- a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +++ b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp @@ -98,7 +98,7 @@ class Pendulum * state is considered terminal. * @param doneReward The reward recieved by the agent on success. * @param maxSteps The number of steps after which the episode - * terminates. If the value is 0, there is no limit. + * terminates. If the value is 0, there is no limit (Default: 200 steps). */ Pendulum(const double maxAngularVelocity = 8, const double maxTorque = 2.0, From f9bdc4b9b1e6c5be56cf3f28dc02eac53db7e467 Mon Sep 17 00:00:00 2001 From: nishantkr18 Date: Wed, 8 Apr 2020 00:27:24 +0530 Subject: [PATCH 4/4] updated History.md --- HISTORY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index bcd3e5fac6..5bf264ec8f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,7 @@ ### mlpack ?.?.? ###### ????-??-?? + * Updated terminal state for Pendulum environment (#2354). + * Templated return type of `Forward function` of loss functions (#2339). * Added `R2 Score` regression metric (#2323).