CCL Library
1.0
|
CCL header file for learning nullspace component. More...
#include <ccl_math.h>
#include <ccl_learn_alpha.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_sf.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
Go to the source code of this file.
Data Structures | |
struct | LEARN_NCL_MODEL |
This structure describes a "LEARN_NCL_MODEL" (a learn ncl model). This structure constains the dimentionality of the defined problems and the model parameters. It should always initialised with ccl_learn_ncl_model_alloc, and destroyed with ccl_learn_ncl_model_free. More... | |
struct | LEARN_MODEL_WS |
This structure describes workspace for directly learning the model parameters using linear regression. More... | |
struct | OBJ_WS |
This structure defines the workspace variables for calculating objective functions. More... | |
struct | SOLVE_NONLIN_WS |
This structure defines the workspace variables for solving the non-linear LM optimization. More... | |
Functions | |
int | ccl_learn_ncl_model_alloc (LEARN_NCL_MODEL *model) |
Allocates the memory for the learn_ncl model. More... | |
int | ccl_learn_ncl_model_free (LEARN_NCL_MODEL *model) |
Free the memory for the learn_ncl model. More... | |
void | ccl_learn_ncl (const double *X, const double *Y, const int dim_x, const int dim_y, const int dim_n, const int dim_b, LEARN_NCL_MODEL *model) |
Computation routine for learn nullspace component . More... | |
void | ccl_learn_model_dir (LEARN_NCL_MODEL *model, const double *BX, const double *Y) |
Computation routine for calculating residual errors. More... | |
int | ccl_learn_model_ws_alloc (LEARN_NCL_MODEL *model, LEARN_MODEL_WS *ws) |
Allocates the memory for LEARN_MODEL_WS structure. More... | |
int | ccl_learn_model_ws_free (LEARN_MODEL_WS *ws) |
Free the memory for LEARN_MODEL_WS structure. More... | |
void | obj_ncl (const LEARN_NCL_MODEL *model, const double *W, const double *BX, const double *Y, double *fun, double *J) |
Computation routine for calculating residual errors. More... | |
void | obj_ws_alloc (const LEARN_NCL_MODEL *model, OBJ_WS *ws) |
Allocates the memory for OBJ_WS structure. More... | |
void | obj_ws_free (OBJ_WS *ws) |
Free the memory for OBJ_WS structure. More... | |
void | ccl_lsqnonlin (const LEARN_NCL_MODEL *model, const double *BX, const double *Y, const OPTION option, SOLVE_NONLIN_WS *lm_ws_param, double *W) |
Computation routine for optimizing non-linear objective functions using LM approach. More... | |
int | ccl_solve_nonlin_ws_alloc (const LEARN_NCL_MODEL *model, SOLVE_NONLIN_WS *lm_ws) |
Allocates the memory for SOLVE_NONLIN_WS structure. More... | |
int | ccl_solve_nonlin_ws_free (SOLVE_NONLIN_WS *lm_ws) |
Free the memory for SOLVE_NONLIN_WS structure. More... | |
void | predict_ncl (const LEARN_NCL_MODEL *model, const double *BX, double *Unp) |
Prediction of nullspace components. More... | |
int | ccl_write_ncl_model (char *filename, LEARN_NCL_MODEL *model) |
Write model parameters to .txt file. More... | |
CCL header file for learning nullspace component.
void ccl_learn_model_dir | ( | LEARN_NCL_MODEL * | model, |
const double * | BX, | ||
const double * | Y | ||
) |
Computation routine for calculating residual errors.
[in] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
[in] | BX | Transformed state variables, must point to an array of dim_b * dim_n of doubles |
[in] | Y | Observation actions |
[out] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
int ccl_learn_model_ws_alloc | ( | LEARN_NCL_MODEL * | model, |
LEARN_MODEL_WS * | ws | ||
) |
Allocates the memory for LEARN_MODEL_WS structure.
[in] | model | Must point to a valid LEARN_MODEL_WS structure |
int ccl_learn_model_ws_free | ( | LEARN_MODEL_WS * | ws | ) |
Free the memory for LEARN_MODEL_WS structure.
[in] | model | Must point to a valid LEARN_MODEL_WS structure |
void ccl_learn_ncl | ( | const double * | X, |
const double * | Y, | ||
const int | dim_x, | ||
const int | dim_y, | ||
const int | dim_n, | ||
const int | dim_b, | ||
LEARN_NCL_MODEL * | model | ||
) |
Computation routine for learn nullspace component .
[in] | X | Input state variables, must point to an array of dim_x * dim_n doubles |
[in] | Y | Observation actions |
[in] | dim_x | Dimensionality of state inputs |
[in] | dim_y | Dimensionality of action space |
[in] | dim_y | Number of data samples |
[in] | dim_y | Dimensionality of rbf |
[out] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
int ccl_learn_ncl_model_alloc | ( | LEARN_NCL_MODEL * | model | ) |
Allocates the memory for the learn_ncl model.
[in] | model | Must point to a valid LEARN_NCL_MODEL structure |
int ccl_learn_ncl_model_free | ( | LEARN_NCL_MODEL * | model | ) |
Free the memory for the learn_ncl model.
[in] | model | Must point to a valid LEARN_NCL_MODEL structure |
void ccl_lsqnonlin | ( | const LEARN_NCL_MODEL * | model, |
const double * | BX, | ||
const double * | Y, | ||
const OPTION | option, | ||
SOLVE_NONLIN_WS * | lm_ws_param, | ||
double * | W | ||
) |
Computation routine for optimizing non-linear objective functions using LM approach.
[in] | model | Must be pointer to a valid LEARN_NCL_MODEL structure. |
[in] | BX | Transformed state variables, must point to an array of dim_b * dim_n of doubles |
[in] | Y | Observation actions |
[in] | option | Options for optimizer |
[in] | lm_ws_param | Must point to a valid structure of SOLVE_LM_WS for LM optimizer workspace variables |
[out] | W | Returned model parameter, must point to an array of dim_b * dim_x doubles |
int ccl_solve_nonlin_ws_alloc | ( | const LEARN_NCL_MODEL * | model, |
SOLVE_NONLIN_WS * | lm_ws | ||
) |
Allocates the memory for SOLVE_NONLIN_WS structure.
[in] | model | Must point to a valid SOLVE_NONLIN_WS structure |
int ccl_solve_nonlin_ws_free | ( | SOLVE_NONLIN_WS * | lm_ws | ) |
Free the memory for SOLVE_NONLIN_WS structure.
[in] | model | Must point to a valid SOLVE_NONLIN_WS structure |
int ccl_write_ncl_model | ( | char * | filename, |
LEARN_NCL_MODEL * | model | ||
) |
Write model parameters to .txt file.
[in] | filename | File name |
[in] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
void obj_ncl | ( | const LEARN_NCL_MODEL * | model, |
const double * | W, | ||
const double * | BX, | ||
const double * | Y, | ||
double * | fun, | ||
double * | J | ||
) |
Computation routine for calculating residual errors.
[in] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
[in] | W | Returned model parameter, must point to an array of dim_b * dim_x doubles |
[in] | BX | Transformed state variables, must point to an array of dim_b * dim_n of doubles |
[in] | Y | Observation actions |
[out] | fun | Returned scalar residual |
[out] | J | Returned Jacobian matrix, must point to an array of dim_n * dim_x doubles |
void obj_ws_alloc | ( | const LEARN_NCL_MODEL * | model, |
OBJ_WS * | ws | ||
) |
void obj_ws_free | ( | OBJ_WS * | ws | ) |
void predict_ncl | ( | const LEARN_NCL_MODEL * | model, |
const double * | BX, | ||
double * | Unp | ||
) |
Prediction of nullspace components.
[in] | model | Must be pointer to a valid LEARN_NCL_MODEL structure |
[in] | BX | Higher dimensionality of the input variable, must point to an array of dim_b * dim_n doubles |
[out] | Unp | Prediction of nullspace component, must point to an array of dim_u * dum_n doubles |