The gnn_weight : Affine / Linear Transform node type implements the function given by
where
is a matrix of size
and
is a vector of size
. Basically, the gnn_weight : Affine / Linear Transform computes an affine transform. Using the nomenclature used in relation with neural networks, the matrix
is the "weights matrix" and
is the "bias vector".
The same function written in index notation is:
where the index
runs over all outputs, i.e.
and
runs over the inputs
. The following figure shows how the different terms affect the inputs:
The gnn_weight : Affine / Linear Transform node is very versatile. Depending on the point of view, it can be seen as carrying out many different types of functions.
A new weight layer can be built using the gnn_weight_new function. There are several ways to initialize or set its values. These can be set per example set randomly with gnn_weight_init, or fixed with alternative linear transforms like Cosine Transform, Hadamard or Karhunen-Loeve. The matrix
can be though as a graph's adyacency matrix, where
corresponds to the connection strength of the input
with the output
.
Modules | |
| gnn_weight Connectionist Tools. | |
| Connectionist Tools for gnn_weight. | |
Typedefs | |
| typedef _gnn_weight | gnn_weight |
| The structure for a gnn_weight : Affine / Linear Transform node. | |
Functions | |
| int | gnn_weight_f (gnn_node *node, const gsl_vector *x, const gsl_vector *w, gsl_vector *y) |
| Computes the evaluation. | |
| int | gnn_weight_dx (gnn_node *node, const gsl_vector *x, const gsl_vector *w, const gsl_vector *dy, gsl_vector *dx) |
| Computes the gnn_weight : Affine / Linear Transform gradient with respect to its inputs. | |
| int | gnn_weight_dw (gnn_node *node, const gsl_vector *x, const gsl_vector *w, const gsl_vector *dy, gsl_vector *dw) |
| Computes the gnn_weight : Affine / Linear Transform gradient with respect to its parameters. | |
| void | gnn_weight_destroy (gnn_node *node) |
| The destroy function for a gnn_weight : Affine / Linear Transform. | |
| gnn_node * | gnn_weight_new (int input_size, int output_size) |
| Creates a new gnn_weight : Affine / Linear Transform layer. | |
| int | gnn_weight_init (gnn_node *node) |
| Initializes the layer's parameters. | |
| gsl_matrix * | gnn_weight_get_A (gnn_node *node) |
Gets the node's parameter matrix
. | |
| gsl_vector * | gnn_weight_get_B (gnn_node *node) |
Gets the node's parameter vector
. | |
| gsl_matrix * | gnn_weight_get_dA (gnn_node *node) |
Gets
. | |
| gsl_vector * | gnn_weight_get_dB (gnn_node *node) |
Gets
. | |
| gsl_matrix_int * | gnn_weight_get_Af (gnn_node *node) |
Gets the frozen flags for the matrix
. | |
| gsl_vector_int * | gnn_weight_get_Bf (gnn_node *node) |
Gets the frozen flags for the vector
. | |
|
|
This datatype holds the information for a gnn_weight : Affine / Linear Transform node. Basically, it extends the gnn_node with special pointers to get fast accesses to the matrices and vectors Definition at line 85 of file gnn_weight.c. |
|
|
This functions computes is the gnn_weight : Affine / Linear Transform destroy function, which destroys the type's specific data.
Definition at line 275 of file gnn_weight.c. |
|
||||||||||||||||||||||||
|
This functions computes:
where
and
Definition at line 235 of file gnn_weight.c. |
|
||||||||||||||||||||||||
|
This functions computes:
or, written in matrix notation:
Definition at line 197 of file gnn_weight.c. |
|
||||||||||||||||||||
|
This functions computes:
or written in matrix notation:
Definition at line 163 of file gnn_weight.c. |
|
|
This function a pointer to the node's internal parameter matrix
Definition at line 431 of file gnn_weight.c. |
|
|
This function returns a pointer to the node's internal matrix frozen flags. Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called. Remember that these values should be binary, beeing either 0 (free) or 1 (frozen).
Definition at line 526 of file gnn_weight.c. |
|
|
This function a pointer to the node's internal parameter vector
Definition at line 454 of file gnn_weight.c. |
|
|
This function returns a pointer to the node's internal vector frozen flags. Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called. Remember that these values should be binary, beeing either 0 (free) or 1 (frozen).
Definition at line 550 of file gnn_weight.c. |
|
|
This function a pointer to the node's internal parameter matrix gradient
Definition at line 478 of file gnn_weight.c. |
|
|
This function a pointer to the node's internal parameter vector gradient
Definition at line 502 of file gnn_weight.c. |
|
|
This functions initializes the layer's parameters by values drawn from a uniform distribution with mean zero and standard deviation
to insure that each of the outputs Implementation Note: The numbers are generated by
where
Definition at line 383 of file gnn_weight.c. |
|
||||||||||||
|
This function creates a new gnn_node of gnn_weight : Affine / Linear Transform type.
Definition at line 296 of file gnn_weight.c. |
1.2.18