NeuralEngine A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes. |

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar > Class Template Reference
Inheritance diagram for NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >:
[legend]
Collaboration diagram for NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >:
[legend]

## Public Member Functions
| NonlinearObjectiveFunction (int numberOfVariables)
| Constructor. More...
| NonlinearObjectiveFunction (int numberOfVariables, std::function< Scalar(const af::array &, af::array &)> function)
| Creates a new objective function specified through a string. More...
| ~NonlinearObjectiveFunction ()
| Destructor. More...
std::function< Scalar(const af::array &, af::array &)> | GetFunction ()
| Gets the objective function. More...
void | SetFunction (std::function< Scalar(const af::array &, af::array &)> func)
| Gets the objective function. More...
Scalar | Value (const af::array &x)
| Computes function value of given x. More...
af::array | Gradient (const af::array &x)
| Gradient of given x. More...
int | GetNumberOfVariables ()
| Gets the number of input variables for the function. More...
void | CheckGradient (const af::array &probe)
| Checks the gradient. More...
af::array | FiniteGradient (const af::array &x, int accuracy=0)
| Finite gradient computation. More...
af::array & | LowerBound ()
| Lower bound. More...
af::array & | UpperBound ()
| Upper bound. More...

## Protected Member Functions
| NonlinearObjectiveFunction ()
| Initializes a new instance of the NonlinearObjectiveFunction class. More...

## Protected Attributes
int | _numVariables
std::function< Scalar(const af::array &, af::array &)> | _function
af::array | _gradient
af::array | afLowerBound
af::array | afUpperBound

## Private Attributes
af::dtype | _dtype

## Detailed Description

template<typename Scalar>
class NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >

Definition at line 20 of file NonlinearObjectiveFunction.h.

## Constructor & Destructor Documentation

## ◆ NonlinearObjectiveFunction() [1/3]

template<typename Scalar >

NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::NonlinearObjectiveFunction | ( | int | numberOfVariables | ) |

Constructor.

Hmetal T, 11/06/2019.

Parameters

  numberOfVariables | Number of variables.

## ◆ NonlinearObjectiveFunction() [2/3]

template<typename Scalar >

NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::NonlinearObjectiveFunction | ( | int | numberOfVariables,
|  | std::function< Scalar(const af::array &, af::array &)> | function
| ) |  |

Creates a new objective function specified through a string.

Hmetal T, 18.03.2017.

Parameters

  numberOfVariables | The number of parameters in the function .
  function | A lambda expression defining the objective function.

## ◆ ~NonlinearObjectiveFunction()

template<typename Scalar >

NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::~NonlinearObjectiveFunction | ( |  | ) |

Destructor.

Admin, 3/21/2017.

## ◆ NonlinearObjectiveFunction() [3/3]

template<typename Scalar >

NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::NonlinearObjectiveFunction | ( |  | ) |
| protected

Initializes a new instance of the NonlinearObjectiveFunction class.

Hmetal T, 18.03.2017.

## Member Function Documentation

## ◆ GetFunction()

template<typename Scalar >

std::function< Scalar(const af::array &, af::array &)> NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::GetFunction | ( |  | ) |
| virtual

Gets the objective function.

Hmetal T, 18.03.2017.

Returns
  The function.

Implements NeuralEngine::MachineLearning::IObjectiveFunction< Scalar >.

## ◆ SetFunction()

template<typename Scalar >

void NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::SetFunction | ( | std::function< Scalar(const af::array &, af::array &)> | func | ) |

Gets the objective function.

Hmetal T, 18.03.2017.

Returns
  The function.

## ◆ Value()

template<typename Scalar >

Scalar NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::Value | ( | const af::array & | x | ) |

Computes function value of given x.

Hmetal T, 10/06/2019.

Parameters

  inX | [in,out] The in x coordinate.

Returns
  A Scalar.

## ◆ Gradient()

template<typename Scalar >

af::array NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::Gradient | ( | const af::array & | x | ) |

Gradient of given x.

Hmetal T, 10/06/2019.

Parameters

  x | [in,out] The af::array to process.

Returns
  An af::array.

## ◆ GetNumberOfVariables()

template<typename Scalar >

int NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::GetNumberOfVariables | ( |  | ) |
| virtual

Gets the number of input variables for the function.

Hmetal T, 18.03.2017.

Returns
  The number of variables.

Implements NeuralEngine::MachineLearning::IObjectiveFunction< Scalar >.

## ◆ CheckGradient()

template<typename Scalar >

void NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::CheckGradient | ( | const af::array & | probe | ) |

Checks the gradient.

Hmetal T, 08/07/2019.

Parameters

  probe | The probe.

## ◆ FiniteGradient()

template<typename Scalar >

af::array NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::FiniteGradient | ( | const af::array & | x,
|  | int | accuracy = `0`
| ) |  |

Finite gradient computation.

Hmetal T, 08/07/2019.

Parameters

  x | The af::array to process.
  accuracy | (Optional) the accuracycan be 0, 1, 2, 3

Returns
  Numerical gradient.

## ◆ LowerBound()

template<typename Scalar >

af::array & NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::LowerBound | ( |  | ) |

Lower bound.

Hmetal T, 12/06/2019.

Returns
  A reference to an af::array.

## ◆ UpperBound()

template<typename Scalar >

af::array & NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::UpperBound | ( |  | ) |

Upper bound.

Hmetal T, 12/06/2019.

Returns
  A reference to an af::array.

## Member Data Documentation

## ◆ _numVariables

template<typename Scalar >

int NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::_numVariables
| protected

Definition at line 168 of file NonlinearObjectiveFunction.h.

## ◆ _function

template<typename Scalar >

std::function<Scalar(const af::array&, af::array&)> NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::_function
| protected

Definition at line 169 of file NonlinearObjectiveFunction.h.

## ◆ _gradient

template<typename Scalar >

af::array NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::_gradient
| protected

Definition at line 171 of file NonlinearObjectiveFunction.h.

## ◆ afLowerBound

template<typename Scalar >

af::array NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::afLowerBound
| protected

Definition at line 173 of file NonlinearObjectiveFunction.h.

## ◆ afUpperBound

template<typename Scalar >

af::array NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::afUpperBound
| protected

Definition at line 174 of file NonlinearObjectiveFunction.h.

## ◆ _dtype

template<typename Scalar >

af::dtype NeuralEngine::MachineLearning::NonlinearObjectiveFunction< Scalar >::_dtype
| private

Definition at line 177 of file NonlinearObjectiveFunction.h.

The documentation for this class was generated from the following file:

- NonlinearObjectiveFunction.h