Objective function for single and double non-Markov poles. More...
#include <shark/ObjectiveFunctions/Benchmarks/NonMarkovPole.h>
Inheritance diagram for shark::benchmarks::NonMarkovPole:Public Member Functions | |
| NonMarkovPole (bool single, std::size_t hidden, bool bias, RecurrentStructure::SigmoidType sigmoidType=RecurrentStructure::FastSigmoid, bool normalize=true, std::size_t max_pole_evaluations=100000) | |
| ~NonMarkovPole () | |
| std::string | name () |
| std::size_t | numberOfVariables () const |
| Returns degrees of freedom. | |
| SearchPointType | proposeStartingPoint () const |
| Always proposes to start in a zero vector with appropriate degrees of freedom. | |
| ResultType | eval (const SearchPointType &input) const |
| Evaluates weight vector on fitness function. | |
Public Member Functions inherited from shark::AbstractObjectiveFunction< RealVector, double > | |
| const Features & | features () const |
| virtual void | updateFeatures () |
| bool | hasValue () const |
| returns whether this function can calculate it's function value | |
| bool | hasFirstDerivative () const |
| returns whether this function can calculate the first derivative | |
| bool | hasSecondDerivative () const |
| returns whether this function can calculate the second derivative | |
| bool | canProposeStartingPoint () const |
| returns whether this function can propose a starting point. | |
| bool | isConstrained () const |
| returns whether this function can return | |
| bool | hasConstraintHandler () const |
| returns whether this function can return | |
| bool | canProvideClosestFeasible () const |
| Returns whether this function can calculate thee closest feasible to an infeasible point. | |
| bool | isThreadSafe () const |
| Returns true, when the function can be usd in parallel threads. | |
| bool | isNoisy () const |
| Returns true, when the function can be usd in parallel threads. | |
| AbstractObjectiveFunction () | |
| Default ctor. | |
| virtual | ~AbstractObjectiveFunction () |
| Virtual destructor. | |
| virtual void | init () |
| void | setRng (random::rng_type *rng) |
| Sets the Rng used by the objective function. | |
| virtual bool | hasScalableDimensionality () const |
| virtual void | setNumberOfVariables (std::size_t numberOfVariables) |
| Adjusts the number of variables if the function is scalable. | |
| virtual std::size_t | numberOfObjectives () const |
| virtual bool | hasScalableObjectives () const |
| virtual void | setNumberOfObjectives (std::size_t numberOfObjectives) |
| Adjusts the number of objectives if the function is scalable. | |
| std::size_t | evaluationCounter () const |
| Accesses the evaluation counter of the function. | |
| AbstractConstraintHandler< SearchPointType > const & | getConstraintHandler () const |
| Returns the constraint handler of the function if it has one. | |
| virtual bool | isFeasible (const SearchPointType &input) const |
| Tests whether a point in SearchSpace is feasible, e.g., whether the constraints are fulfilled. | |
| virtual void | closestFeasible (SearchPointType &input) const |
| If supported, the supplied point is repaired such that it satisfies all of the function's constraints. | |
| ResultType | operator() (SearchPointType const &input) const |
| Evaluates the function. Useful together with STL-Algorithms like std::transform. | |
| virtual ResultType | evalDerivative (SearchPointType const &input, FirstOrderDerivative &derivative) const |
| Evaluates the objective function and calculates its gradient. | |
| virtual ResultType | evalDerivative (SearchPointType const &input, SecondOrderDerivative &derivative) const |
| Evaluates the objective function and calculates its gradient. | |
Public Member Functions inherited from shark::INameable | |
| virtual | ~INameable () |
| virtual std::string | name () const |
| returns the name of the object | |
Additional Inherited Members | |
Public Types inherited from shark::AbstractObjectiveFunction< RealVector, double > | |
| enum | Feature |
| List of features that are supported by an implementation. More... | |
| typedef RealVector | SearchPointType |
| typedef double | ResultType |
| typedef boost::mpl::if_< std::is_arithmetic< double >, SearchPointType, RealMatrix >::type | FirstOrderDerivative |
| typedef TypedFlags< Feature > | Features |
| This statement declares the member m_features. See Core/Flags.h for details. | |
| typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
Protected Member Functions inherited from shark::AbstractObjectiveFunction< RealVector, double > | |
| void | announceConstraintHandler (AbstractConstraintHandler< SearchPointType > const *handler) |
| helper function which is called to announce the presence of an constraint handler. | |
Protected Attributes inherited from shark::AbstractObjectiveFunction< RealVector, double > | |
| Features | m_features |
| std::size_t | m_evaluationCounter |
| Evaluation counter, default value: 0. | |
| AbstractConstraintHandler< SearchPointType > const * | m_constraintHandler |
| random::rng_type * | mep_rng |
Objective function for single and double non-Markov poles.
Class for balancing one or two poles on a cart using a fitness function that decreases the longer the pole(s) balance(s). Based on code written by Verena Heidrich-Meisner for the paper
V. Heidrich-Meisner and C. Igel. Neuroevolution strategies for episodic reinforcement learn-ing. Journal of Algorithms, 64(4):152–168, 2009.
Definition at line 60 of file NonMarkovPole.h.
|
inline |
| single | Is this an instance of the single pole problem? |
| hidden | Number of hidden neurons in underlying neural network |
| bias | Whether to use bias in neural network |
| sigmoidType | Activation sigmoid function for neural network |
| normalize | Whether to normalize input before use in neural network |
| max_pole_evaluations | Balance goal of the function, i.e. number of steps that pole should be able to balance without failure |
Definition at line 69 of file NonMarkovPole.h.
References shark::AbstractObjectiveFunction< RealVector, double >::CAN_PROPOSE_STARTING_POINT, shark::AbstractObjectiveFunction< RealVector, double >::m_evaluationCounter, and shark::AbstractObjectiveFunction< RealVector, double >::m_features.
|
inline |
Definition at line 121 of file NonMarkovPole.h.
|
inlinevirtual |
Evaluates weight vector on fitness function.
| input | Vector to be evaluated. |
Reimplemented from shark::AbstractObjectiveFunction< RealVector, double >.
Definition at line 147 of file NonMarkovPole.h.
References shark::AbstractObjectiveFunction< RealVector, double >::m_evaluationCounter, and SIZE_CHECK.
|
inline |
Definition at line 126 of file NonMarkovPole.h.
|
inlinevirtual |
Returns degrees of freedom.
Implements shark::AbstractObjectiveFunction< RealVector, double >.
Definition at line 131 of file NonMarkovPole.h.
|
inlinevirtual |
Always proposes to start in a zero vector with appropriate degrees of freedom.
Reimplemented from shark::AbstractObjectiveFunction< RealVector, double >.
Definition at line 136 of file NonMarkovPole.h.