diff --git a/HISTORY.md b/HISTORY.md index 9e5c560e5b..cc43905132 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,7 @@ ### mlpack ?.?.? ###### ????-??-?? + * Updated terminal state for Pendulum environment (#2354). + * Added `EliSH` activation function (#2323). * Add L1 Loss function (#2203). diff --git a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp index 55c02668cd..770e4ee020 100644 --- a/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +++ b/src/mlpack/methods/reinforcement_learning/environment/pendulum.hpp @@ -98,14 +98,14 @@ 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, 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), @@ -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; }