Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

gnn_weight : Affine / Linear Transform
[Atomic Nodes.]


Detailed Description

Todo:
Include more transformations (1-D and 2-D), and check other uses.

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_nodegnn_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 .


Typedef Documentation

typedef struct _gnn_weight gnn_weight
 

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 , , , and their frozen flags in order to improve the efficiency.

Definition at line 85 of file gnn_weight.c.


Function Documentation

void gnn_weight_destroy gnn_node   node [static]
 

This functions computes is the gnn_weight : Affine / Linear Transform destroy function, which destroys the type's specific data.

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform.

Definition at line 275 of file gnn_weight.c.

int gnn_weight_dw gnn_node   node,
const gsl_vector *    x,
const gsl_vector *    w,
const gsl_vector *    dy,
gsl_vector *    dw
[static]
 

This functions computes:

where is defined as . Or written in matrix notation:

and

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform node.
x  A pointer to the input vector .
w  A pointer to the parameter vector .
dy  A pointer to the vector .
dw  A pointer to the vector where the result should be placed.
Returns:
Returns 0 if suceeded.

Definition at line 235 of file gnn_weight.c.

int gnn_weight_dx gnn_node   node,
const gsl_vector *    x,
const gsl_vector *    w,
const gsl_vector *    dy,
gsl_vector *    dx
[static]
 

This functions computes:

or, written in matrix notation:

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform node.
x  A pointer to the input vector .
w  A pointer to the parameter vector .
dy  A pointer to the vector .
dx  A pointer to the vector where the result should be placed.
Returns:
Returns 0 if suceeded.

Definition at line 197 of file gnn_weight.c.

int gnn_weight_f gnn_node   node,
const gsl_vector *    x,
const gsl_vector *    w,
gsl_vector *    y
[static]
 

This functions computes:

or written in matrix notation:

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform node.
x  A pointer to the input vector .
w  A pointer to the parameter vector .
y  A pointer to the output vector where the result should be placed.
Returns:
Returns 0 if suceeded.

Definition at line 163 of file gnn_weight.c.

gsl_matrix* gnn_weight_get_A gnn_node   node
 

This function a pointer to the node's internal parameter matrix . Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called.

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform.
Returns:
A pointer to a matrix.

Definition at line 431 of file gnn_weight.c.

gsl_matrix_int* gnn_weight_get_Af gnn_node   node
 

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).

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform.
Returns:
A pointer to a matrix.

Definition at line 526 of file gnn_weight.c.

gsl_vector* gnn_weight_get_B gnn_node   node
 

This function a pointer to the node's internal parameter vector . Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called.

Parameters:
node  A pointer to a gnn_node.
Returns:
A pointer to a vector.

Definition at line 454 of file gnn_weight.c.

gsl_vector_int* gnn_weight_get_Bf gnn_node   node
 

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).

Parameters:
node  A pointer to a gnn_node.
Returns:
A pointer to a vector.

Definition at line 550 of file gnn_weight.c.

gsl_matrix* gnn_weight_get_dA gnn_node   node
 

This function a pointer to the node's internal parameter matrix gradient . Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called.

Parameters:
node  A pointer to a gnn_weight : Affine / Linear Transform.
Returns:
A pointer to a matrix.

Definition at line 478 of file gnn_weight.c.

gsl_vector* gnn_weight_get_dB gnn_node   node
 

This function a pointer to the node's internal parameter vector gradient . Its values can be freely modified, but after changes are made, the gnn_node_local_update function should be called.

Parameters:
node  A pointer to a gnn_node.
Returns:
A pointer to a vector.

Definition at line 502 of file gnn_weight.c.

int gnn_weight_init gnn_node   node
 

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 are approximately .

Implementation Note: The numbers are generated by

where is drawn from a uniform distribution in .

Parameters:
layer  A pointer to a gnn_weight : Affine / Linear Transform node.
Returns:
Returns 0 on success.

Definition at line 383 of file gnn_weight.c.

gnn_node* gnn_weight_new int    input_size,
int    output_size
 

This function creates a new gnn_node of gnn_weight : Affine / Linear Transform type.

Parameters:
input_size  The node's input size.
output_size  The node's output size.
Returns:
A new node.

Definition at line 296 of file gnn_weight.c.


Generated on Sun Jun 13 20:51:44 2004 for libgnn Gradient Retropropagation Machine Library by doxygen1.2.18