#include "gnn_globals.h"Include dependency graph for gnn_criterion.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | _gnn_criterion |
Typedefs | |
| typedef _gnn_criterion | gnn_criterion |
| The datatype for criterions. | |
| typedef double(* | gnn_criterion_e )(gnn_criterion *crit, const gsl_vector *y, const gsl_vector *t) |
| The datatype for criterions evaluation functions. | |
| typedef int(* | gnn_criterion_dy )(gnn_criterion *crit, const gsl_vector *y, const gsl_vector *t, gsl_vector *dy) |
The datatype for
. | |
| typedef void(* | gnn_criterion_destructor )(gnn_criterion *crit) |
| The datatype for destructors for criterion extensions. | |
Functions | |
| int | gnn_criterion_init (gnn_criterion *crit, const char *type, size_t size, gnn_criterion_e e, gnn_criterion_dy dy, gnn_criterion_destructor destroy) |
| Initializes a gnn_criterion : Basic Criterion Function.. | |
| size_t | gnn_criterion_get_size (gnn_criterion *crit) |
| Returns a criterion's size. | |
| const char * | gnn_criterion_get_type (gnn_criterion *crit) |
| Returns the name of the criterion. | |
| double | gnn_criterion_evaluate_e (gnn_criterion *crit, const gsl_vector *y, const gsl_vector *t) |
| Evaluates the criterion. | |
| int | gnn_criterion_evaluate_dy (gnn_criterion *crit, gsl_vector *dy) |
| Evaluates the criterion's gradient. | |
| void | gnn_criterion_destroy (gnn_criterion *crit) |
| Destroys the criterion. | |
| int | gnn_criterion_eval_dy (gnn_criterion *crit, gsl_vector *dy) |
| Evaluates the criterion's gradient. | |
|
|
This function destroys a given criterion structure by freeing its memory. It will call the specific destroy function (if any) for the criterion, which was previosly installed. Then it frees the fields of gnn_criterion : Basic Criterion Function. and the structure itself.
Definition at line 365 of file gnn_criterion.c. |
|
||||||||||||
|
This function evaluates the criterion's gradient with respect to the last evaluated estimation
This function calls the criterion's specific gradient function.
Definition at line 345 of file gnn_criterion.c. |
|
||||||||||||
|
This function evaluates the criterion's gradient with respect to the last evaluated estimation
Definition at line 309 of file gnn_criterion.c. |
|
||||||||||||||||
|
This function evaluates the criterion for the given vectors "y" and "t", which are (usually) the Models output It will call the specific evaluation function for the criterion, which was previosly installed.
Definition at line 279 of file gnn_criterion.c. |
|
|
This functions returns the size
Definition at line 237 of file gnn_criterion.c. |
|
|
This functions returns a string which identifies uniquely the current criterion's type.
Definition at line 255 of file gnn_criterion.c. |
|
||||||||||||||||||||||||||||
|
This function initializes a gnn_criterion : Basic Criterion Function. by setting its size and installing the specific functions for It is mandatory to provide:
In example, suppose you want to implement a criterion called "my_criterion" and that you have already coded the evaluation function and the gradient function, which you called "my_criterion_e" and "my_criterion_dy" respectivelly. Your criterion doesn't need any additional data to compute them, so you didn't extend the basic gnn_criterion : Basic Criterion Function.. Then, the code would be a template for the constructor: gnn_criterion * my_criterion_new (size_t size) { int status; gnn_criterion *crit; // allocate memory for the criterion crit = (gnn_criterion *) malloc (sizeof (gnn_criterion)); // initialize status = gnn_criterion_init (crit, "my criterion", size, my_criterion_e, my_criterion_dy, my_criterion_destroy); if (status) print_an_error_message_and_return_null (); // return return crit; }
Definition at line 181 of file gnn_criterion.c. |
1.2.18