The following scheme shows a gnn_phandle. It is important to note that:
Also, the gnn_pbundle interface can be used to manipulate a set of related parameter handles.
Data Structures | |
| struct | gnn_phandle |
| The gnn_phandle type. More... | |
Typedefs | |
| typedef enum _phandle_update | phandle_update |
| A type for update flags. | |
Functions | |
| void | gnn_phandle_destroy (gnn_phandle *ph) |
| Destroys a parameter handle. | |
| int | gnn_vector_use_flags (gsl_vector *v, const gsl_vector_int *f) |
| Set the frozen parameters to zero. | |
| int | gnn_vector_int_count_frozen_flags (const gsl_vector_int *f) |
| Counts the amount of frozen flags. | |
| gnn_phandle * | gnn_phandle_new (size_t size) |
| Creates a new parameter handle. | |
| int | gnn_phandle_unref (gnn_phandle *ph) |
| Unreferences a parameter handle. | |
| int | gnn_phandle_ref (gnn_phandle *ph) |
| References a parameter handle. | |
| size_t | gnn_phandle_get_size (gnn_phandle *ph) |
| Returns the total number of parameters. | |
| size_t | gnn_phandle_get_free (gnn_phandle *ph) |
| Returns the number of free parameters. | |
| gsl_vector * | gnn_phandle_get_w (gnn_phandle *ph) |
| Returns a pointer to the internal parameter vector. | |
| gsl_vector * | gnn_phandle_get_dw (gnn_phandle *ph) |
| Returns a pointer to the internal parameter gradient. | |
| gsl_vector_int * | gnn_phandle_get_f (gnn_phandle *ph) |
| Returns a pointer to the internal frozen flags. | |
| int | gnn_phandle_update (gnn_phandle *ph) |
| Updates the handle's fields. | |
Variables | |
| chunkallocator * | _phallocator = NULL |
| The internal memory chunk allocator for parameter handles. | |
|
|
This flag type is used for keeping track of the updates that are necessary. Definition at line 48 of file gnn_phandle.h. |
|
|
This static function deallocates the parameter handle's memory, including its referenced data blocks for parameters. It can't be called publically, because it is only triggered (by gnn_phandle : A Handle for Parameters.) when the reference counter falls to zero.
Definition at line 122 of file gnn_phandle.c. |
|
|
This function returns a pointer to the internal parameter gradient
Definition at line 378 of file gnn_phandle.c. |
|
|
This function returns a pointer to the internal frozen flags It should be remembered that the vector's element have binary values. That is, 0 means "free" parameter, 1 means "frozen" or "fixed" parameter.
Definition at line 404 of file gnn_phandle.c. |
|
|
Definition at line 339 of file gnn_phandle.c. |
|
|
Definition at line 325 of file gnn_phandle.c. |
|
|
This function returns a pointer to the internal parameter vector
Definition at line 358 of file gnn_phandle.c. |
|
|
This function allocates a new parameter handle for the given number of parameters. It creates the underlying blocks of parameters, parameter gradients and freeze flags. It's fields are appropiately initialized. Of course, the number of parameters can perfectly be zero. In this case, the creation of the underlying data blocks is ommitted.
Definition at line 219 of file gnn_phandle.c. |
|
|
This function increases the reference count of the parameter handle. It should be called when the parameters are being shared.
Definition at line 305 of file gnn_phandle.c. |
|
|
This function decreases the reference count of the parameter handle. It should be called when the parameters aren't used anymore. If the reference count drops to zero, then the associated parameters aren't used by anyone, triggering the real deallocation of the handle.
Definition at line 279 of file gnn_phandle.c. |
|
|
This function should be called after changes have made to the handle's vectors w, dw or f, to update the fields and check for consistency.
Definition at line 427 of file gnn_phandle.c. |
|
|
This function takes an integer vector with binary values {0,1} and counts the amount of non-zero values, which correspond to frozen flags.
Definition at line 182 of file gnn_phandle.c. |
|
||||||||||||
|
This function takes a real vector and an integer vector. The integer vector should have binary {0,1} values, that are used as frozen flags. All elements of v whose corresponding frozen flag in f is non-zero is set to zero.
Definition at line 152 of file gnn_phandle.c. |
|
|
This variable points to the parameter handle memory allocator. A first call to gnn_phandle : A Handle for Parameters. instanciates it. Definition at line 87 of file gnn_phandle.c. |
1.2.18