CCL Library
1.0
|
CCL header file for learning unconstraint policy. More...
#include <ccl_math.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>
Go to the source code of this file.
Data Structures | |
struct | LEARN_MODEL_PI_WS |
This structure describes workspace for directly learning the policy model parameters using linear regression. More... | |
struct | LEARN_MODEL_PI |
This structure describes learning a direct linear policy model parameters LEARN_MODEL_PI. More... | |
struct | LEARN_MODEL_LW_PI |
This structure describes learning a direct locally weighted linear policy model parameters LEARN_MODEL_LW_PI. More... | |
struct | LEARN_MODEL_LW_PI_WS |
This structure describes workspace for directly learning the policy model parameters using locally weighted linear regression. More... | |
Macros | |
#define | NUM_CENTRES 20 |
Functions | |
void | ccl_learn_policy_pi (LEARN_MODEL_PI *model, const double *BX, const double *Y) |
Main computation routine for learning linear policy. More... | |
int | ccl_learn_model_pi_ws_alloc (LEARN_MODEL_PI *model, LEARN_MODEL_PI_WS *ws) |
Allocates the workspace memory for directly learning policy pi. More... | |
int | ccl_learn_model_pi_ws_free (LEARN_MODEL_PI_WS *ws) |
Free the workspace memory for directly learning policy pi. More... | |
void | ccl_learn_policy_lw_pi (LEARN_MODEL_LW_PI *model, const double *WX, const double *X, const double *Y) |
Main computation routine for locally weighted linear policy. More... | |
int | ccl_learn_policy_lw_pi_model_alloc (LEARN_MODEL_LW_PI *model) |
Allocates the memory for locally weighted linear policy LEARN_MODEL_LW_PI. More... | |
int | ccl_learn_policy_lw_pi_model_free (LEARN_MODEL_LW_PI *model) |
Free the memory for locally weighted linear policy LEARN_MODEL_LW_PI. More... | |
int | ccl_learn_model_lw_pi_ws_alloc (LEARN_MODEL_LW_PI *model, LEARN_MODEL_LW_PI_WS *ws) |
Allocates the workspace memory for locally weighted linear policy LEARN_MODEL_LW_PI_WS. More... | |
int | ccl_learn_model_lw_pi_ws_free (LEARN_MODEL_LW_PI_WS *ws) |
Free the workspace memory for locally weighted linear policy LEARN_MODEL_LW_PI_WS. More... | |
void | predict_linear (const double *X, const double *centres, const double variance, const LEARN_MODEL_PI *model, double *Yp) |
Predictions based on linear policy model. More... | |
void | predict_local_linear (const double *X, const double *centres, const double variance, const LEARN_MODEL_LW_PI *model, double *Yp) |
Predictions based on locally weighted linear policy model. More... | |
int | ccl_read_data_from_file (char *filename, int dim_x, int dim_n, double *mat) |
Read data from .txt file. More... | |
int | ccl_write_lwmodel_to_file (char *filename, LEARN_MODEL_LW_PI *model) |
Write locally weighted model to .txt file. More... | |
CCL header file for learning unconstraint policy.
#define NUM_CENTRES 20 |
NUM_CENTRES is the number of rbf centers
int ccl_learn_model_lw_pi_ws_alloc | ( | LEARN_MODEL_LW_PI * | model, |
LEARN_MODEL_LW_PI_WS * | ws | ||
) |
Allocates the workspace memory for locally weighted linear policy LEARN_MODEL_LW_PI_WS.
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
[in] | ws | Must point to a valid LEARN_MODEL_LW_PI_WS structure |
int ccl_learn_model_lw_pi_ws_free | ( | LEARN_MODEL_LW_PI_WS * | ws | ) |
Free the workspace memory for locally weighted linear policy LEARN_MODEL_LW_PI_WS.
[in] | ws | Must point to a valid LEARN_MODEL_LW_PI_WS structure |
int ccl_learn_model_pi_ws_alloc | ( | LEARN_MODEL_PI * | model, |
LEARN_MODEL_PI_WS * | ws | ||
) |
Allocates the workspace memory for directly learning policy pi.
[in] | model | Must point to a valid LEARN_MODEL_PI structure |
[in] | ws | Must point to a valid LEARN_MODEL_PI_WS structure |
int ccl_learn_model_pi_ws_free | ( | LEARN_MODEL_PI_WS * | ws | ) |
Free the workspace memory for directly learning policy pi.
[in] | ws | Must point to a valid LEARN_MODEL_PI_WS structure |
void ccl_learn_policy_lw_pi | ( | LEARN_MODEL_LW_PI * | model, |
const double * | WX, | ||
const double * | X, | ||
const double * | Y | ||
) |
Main computation routine for locally weighted linear policy.
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
[in] | WX | Locally weighted inputs, must point to an array of dim_b * dim_n doubles |
[in] | X | Inputs variables, must point to an array of dim_x * dim_n doubles |
[in] | Y | Output variables, must point to an array of dim_y * dim_n doubles |
[out] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
int ccl_learn_policy_lw_pi_model_alloc | ( | LEARN_MODEL_LW_PI * | model | ) |
Allocates the memory for locally weighted linear policy LEARN_MODEL_LW_PI.
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
int ccl_learn_policy_lw_pi_model_free | ( | LEARN_MODEL_LW_PI * | model | ) |
Free the memory for locally weighted linear policy LEARN_MODEL_LW_PI.
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
void ccl_learn_policy_pi | ( | LEARN_MODEL_PI * | model, |
const double * | BX, | ||
const double * | Y | ||
) |
Main computation routine for learning linear policy.
[in] | model | Must point to a valid LEARN_MODEL_PI structure |
[in] | BX | Higher dimensionality of input variable, must point to an array of dim_b * dim_n doubles |
[in] | Y | Ouput variable, must point to an array of dim_y * dim_n doubles. |
[in] | model | Must point to a valid LEARN_MODEL_PI structure |
int ccl_read_data_from_file | ( | char * | filename, |
int | dim_x, | ||
int | dim_n, | ||
double * | mat | ||
) |
Read data from .txt file.
[in] | filename | Name of file |
[in] | dim_x | Dimensionality of input variable |
[in] | dim_n | Number of data samples |
[out] | mat | Returned data matrix |
int ccl_write_lwmodel_to_file | ( | char * | filename, |
LEARN_MODEL_LW_PI * | model | ||
) |
Write locally weighted model to .txt file.
[in] | filename | Name of file |
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
void predict_linear | ( | const double * | X, |
const double * | centres, | ||
const double | variance, | ||
const LEARN_MODEL_PI * | model, | ||
double * | Yp | ||
) |
Predictions based on linear policy model.
[in] | X | Inputs variables, must point to an array of dim_x * dim_n doubles |
[in] | centres | Center of rbf, must point to an array of 1 * dim_b doubles |
[in] | variance | Variance of rbf |
[in] | model | Must point to a valid LEARN_MODEL_PI structure |
[out] | Yp | Predictions |
void predict_local_linear | ( | const double * | X, |
const double * | centres, | ||
const double | variance, | ||
const LEARN_MODEL_LW_PI * | model, | ||
double * | Yp | ||
) |
Predictions based on locally weighted linear policy model.
[in] | X | Inputs variables, must point to an array of dim_x * dim_n doubles |
[in] | centres | Center of rbf, must point to an array of 1 * dim_b doubles |
[in] | variance | Variance of rbf |
[in] | model | Must point to a valid LEARN_MODEL_LW_PI structure |
[out] | Yp | Predictions |