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

gnn_tanh : Hyperbolic Tangent Activation Function.
[Atomic Nodes.]


Detailed Description

This node type implements the Hyperbolic Tangent activation function given by:

where the index runs over all inputs / outputs.

This function is a member of the more general class of sigmoid functions, which have the property to "squash" its inputs to a very restricted output interval.

The Hyperbolic Tangent is symmetric and its outputs lie between . It has been said that it leads to faster convergence in training than the Logistic Sigmoid.

Functions

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

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

gnn_nodegnn_tanh_new (int input_size, double a, double b)
 Creates a Hyperbolic Tangent Activation Function node.

gnn_nodegnn_tanh_standard_new (int input_size)
 Creates a standard Hyperbolic Tangent function node.

gnn_nodegnn_tanh_enhanced_new (int input_size)
 Creates a Hyperbolic Tangent function node.

double gnn_tanh_get_a (gnn_node *node)
 Returns the amplitude constant .

void gnn_tanh_set_a (gnn_node *node, double a)
 Sets the amplitude constant .

double gnn_tanh_get_b (gnn_node *node)
 Gets the streching factor .

void gnn_tanh_set_b (gnn_node *node, double b)
 Sets the streching factor .


Function Documentation

int gnn_tanh_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 hyperbolic tangent function, given dedy ( ). The function is,

Parameters:
node  A pointer to the gnn_tanh 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 148 of file gnn_tanh.c.

gnn_node* gnn_tanh_enhanced_new int    input_size
 

This function creates a node of the gnn_tanh type.

where . The constants are chosen so that when the layer is feed with a linear combination layer with normalized outputs its own outputs have an effective gain of 1.

Parameters:
input_size  The input size .
Returns:
A pointer to a new gnn_tanh node.

Definition at line 281 of file gnn_tanh.c.

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

This functions evaluates the hyperbolic tangent function.

Parameters:
node  A pointer to the gnn_tanh 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 101 of file gnn_tanh.c.

double gnn_tanh_get_a gnn_node   node
 

Parameters:
node  A pointer to the gnn_tanh node.
Returns:
The amplitude of the sigmoid.

Definition at line 294 of file gnn_tanh.c.

double gnn_tanh_get_b gnn_node   node
 

Parameters:
node  A pointer to the gnn_tanh node.
Returns:
The streching factor .

Definition at line 320 of file gnn_tanh.c.

gnn_node* gnn_tanh_new int    input_size,
double    a,
double    b
 

This function creates a node of the gnn_tanh type. This node computes

where , and constant parameters.

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

Definition at line 204 of file gnn_tanh.c.

void gnn_tanh_set_a gnn_node   node,
double    a
 

Parameters:
node  A pointer to the gnn_tanh node.
a  The amplitude factor.

Definition at line 307 of file gnn_tanh.c.

void gnn_tanh_set_b gnn_node   node,
double    b
 

Parameters:
node  A pointer to the gnn_tanh node.
b  The new streching factor .

Definition at line 333 of file gnn_tanh.c.

gnn_node* gnn_tanh_standard_new int    input_size
 

This function creates a layer of the gnn_tanh type:

where .

Parameters:
input_size  The input size .
Returns:
A pointer to a new gnn_tanh node.

Definition at line 262 of file gnn_tanh.c.


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