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

gnn_softmax : Softmax Activation Function.
[Atomic Nodes.]


Detailed Description

The gnn_softmax datatype implements a node that computes the function:

where .

The different outputs of the softmax function are normalized: they sum all up to 1. Softmax outputs lie in the interval , and they can be interpreted as probabilities.

Warning:
This node should be fed with small values.

Functions

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

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

void gnn_softmax_destroy (gnn_node *node)
 Destroys the gnn_softmax specific data.

gnn_nodegnn_softmax_new (int input_size)
 Creates a Softmax activation function node.


Function Documentation

void gnn_softmax_destroy gnn_node   node [static]
 

This is the destructor for gnn_softmax nodes.

Parameters:
node  A pointer to a gnn_softmax node.

Definition at line 206 of file gnn_softmax.c.

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

This functions computes the gradient of the softmax function, given (dy). The function is,

Parameters:
node  A pointer to a gnn_softmax node.
x  The input vector .
w  The parameter vector (which is empty in this case).
dy  The vector .
dx  The output buffer vector .
Returns:
Returns 0 on success.

Definition at line 153 of file gnn_softmax.c.

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

This functions evaluates the softmax function.

Parameters:
node  A pointer to a gnn_softmax node.
x  The input vector .
w  The parameter vector (which is empty in this case).
y  The output buffer vector .
Returns:
Returns 0 on success.

Definition at line 94 of file gnn_softmax.c.

gnn_node* gnn_softmax_new int    input_size
 

This function creates a node of the gnn_softmax type.

Parameters:
input_size  The input size .
a  The factor.
b  The factor.
Returns:
A pointer to a new gnn_softmax node.

Definition at line 237 of file gnn_softmax.c.


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