Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
|
Data Structures | |
struct | adaline |
structure to hold adaline model parameters More... | |
Macros | |
#define | MAX_ADALINE_ITER 500 |
Maximum number of iterations to learn. | |
#define | ADALINE_ACCURACY 1e-5 |
convergence accuracy \(=1\times10^{-5}\) | |
Functions | |
struct adaline | new_adaline (const int num_features, const double eta) |
Default constructor. More... | |
void | delete_adaline (struct adaline *ada) |
delete dynamically allocated memory More... | |
int | adaline_activation (double x) |
Heaviside activation function More... | |
char * | adaline_get_weights_str (const struct adaline *ada) |
Operator to print the weights of the model. More... | |
int | adaline_predict (struct adaline *ada, const double *x, double *out) |
predict the output of the model for given set of features More... | |
double | adaline_fit_sample (struct adaline *ada, const double *x, const int y) |
Update the weights of the model using supervised learning for one feature vector. More... | |
void | adaline_fit (struct adaline *ada, double **X, const int *y, const int N) |
Update the weights of the model using supervised learning for an array of vectors. More... | |
int adaline_activation | ( | double | x | ) |
x | activation function input |
void adaline_fit | ( | struct adaline * | ada, |
double ** | X, | ||
const int * | y, | ||
const int | N | ||
) |
Update the weights of the model using supervised learning for an array of vectors.
[in] | ada | adaline model to train |
[in] | X | array of feature vector |
[in] | y | known output value for each feature vector |
[in] | N | number of training samples |
double adaline_fit_sample | ( | struct adaline * | ada, |
const double * | x, | ||
const int | y | ||
) |
Update the weights of the model using supervised learning for one feature vector.
[in] | ada | adaline model to fit |
[in] | x | feature vector |
[in] | y | known output value |
char * adaline_get_weights_str | ( | const struct adaline * | ada | ) |
Operator to print the weights of the model.
ada | model for which the values to print |
int adaline_predict | ( | struct adaline * | ada, |
const double * | x, | ||
double * | out | ||
) |
predict the output of the model for given set of features
[in] | ada | adaline model to predict |
[in] | x | input vector |
[out] | out | optional argument to return neuron output before applying activation function (NULL to ignore) |
void delete_adaline | ( | struct adaline * | ada | ) |
struct adaline new_adaline | ( | const int | num_features, |
const double | eta | ||
) |
Default constructor.
[in] | num_features | number of features present |
[in] | eta | learning rate (optional, default=0.1) |