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

gnn_parallel : Parallel Node Constructor.
[Constructor Nodes.]


Detailed Description

Todo:
Optimize this node type

gnn_parallel is a constructor node for implementing parallel computing schemes. Given the functions with input sizes and output sizes , it computes the function given by

where , in this order.

Functions

int gnn_parallel_f (gnn_node *node, const gsl_vector *x, const gsl_vector *w, gsl_vector *y)
 Computes the output.

int gnn_parallel_dx (gnn_node *node, const gsl_vector *x, const gsl_vector *w, const gsl_vector *dy, gsl_vector *dx)
 Computes .

int gnn_parallel_dw (gnn_node *node, const gsl_vector *x, const gsl_vector *w, const gsl_vector *dy, gsl_vector *dw)
 Computes .

void gnn_parallel_destroy (gnn_node *node)
 Frees the gnn_parallel specific data.

gnn_nodegnn_parallel_new (size_t size,...)
 Creates a gnn_parallel node.

gnn_nodegnn_parallel_new_with_node_vector (gnn_node_vector *v)
 Creates a gnn_parallel node with a given node vector.

int gnn_parallel_get_input_offset (gnn_node *node, int i)
 Gets the offset of the i-th subnode's input.

int gnn_parallel_get_input_length (gnn_node *node, int i)
 Gets the length of the i-th subnode's input.

int gnn_parallel_get_output_offset (gnn_node *node, int i)
 Gets the offset of the i-th subnode's output.

int gnn_parallel_get_output_length (gnn_node *node, int i)
 Gets the length of the i-th subnode's output.


Function Documentation

void gnn_parallel_destroy gnn_node   node [static]
 

This function (the gnn_parallel destructor) frees the 4 auxiliary arrays allocated for the gnn_parallel node.

Parameters:
node  A pointer to a gnn_parallel node.

Definition at line 270 of file gnn_parallel.c.

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

This functions computes the parameter gradient of the parallel node. Given it computes

where is the gradient with respect of its parameters of the -th function .

Parameters:
node  A pointer to a gnn_parallel node.
x  The input vector .
w  The current parameter vector .
dy  The error-backpropagation vector
dw  Not used, since the stack hasn't any local parameters.
Returns:
0 if succeeded.

Definition at line 233 of file gnn_parallel.c.

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

This functions computes the input gradient of the parallel node. Given it computes

where is the gradient with respect of its inputs of the -th function .

Parameters:
node  A pointer to a gnn_parallel node.
x  The input vector .
w  The current parameter vector .
dy  The error-backpropagation vector
dx  An output vector where the result should be stored.
Returns:
0 if suceeded.

Definition at line 165 of file gnn_parallel.c.

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

This functions computes the parallel function.

Parameters:
node  A pointer to a gnn_parallel node.
x  The input vector .
w  The current parameter vector .
y  An output vector where the result should be stored.
Returns:
0 if succeeded.

Definition at line 96 of file gnn_parallel.c.

int gnn_parallel_get_input_length gnn_node   node,
int    i
 

Parameters:
node  A pointer to a gnn_parallel node.
i  The index.
Returns:
The length.

Definition at line 509 of file gnn_parallel.c.

int gnn_parallel_get_input_offset gnn_node   node,
int    i
 

Parameters:
node  A pointer to a gnn_parallel node.
i  The index.
Returns:
The offset.

Definition at line 487 of file gnn_parallel.c.

int gnn_parallel_get_output_length gnn_node   node,
int    i
 

Parameters:
node  A pointer to a gnn_parallel node.
i  The index.
Returns:
The offset.

Definition at line 553 of file gnn_parallel.c.

int gnn_parallel_get_output_offset gnn_node   node,
int    i
 

Parameters:
node  A pointer to a gnn_parallel node.
i  The index.
Returns:
The offset.

Definition at line 531 of file gnn_parallel.c.

gnn_node* gnn_parallel_new size_t    size,
...   
 

This function creates a node of the gnn_parallel type. Its inputs and outputs are the concatenation of its subnode's inputs and outputs.

Example:

 gnn_node *parallel, *node1, *node2, *node3;

 // build the node 1 to 3
 ...

 // build the parallel node
 parallel = gnn_parallel_new (3, node1, node2, node3);
Parameters:
size  The number of subnodes.
...  A list of pointers to the subnodes.
Returns:
A pointer to a new gnn_parallel node.

Definition at line 320 of file gnn_parallel.c.

gnn_node* gnn_parallel_new_with_node_vector gnn_node_vector   v
 

This function creates a node of the gnn_parallel type. Its inputs and outputs are the concatenation of its subnode's inputs and outputs.

Example:

 gnn_node *parallel;
 gnn_node_vector *vector;

 // build the node vector
 vector = gnn_node_vector_new (3);

 // build the nodes vector[0], vector[1] and vector[2]
 ...

 // build the stack
 parallel = gnn_parallel_new_with_node_vector (vector);
Parameters:
v  A pointer to a gnn_node_vector.
Returns:
A pointer to a new gnn_parallel node.

Definition at line 382 of file gnn_parallel.c.


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