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

gnn_output.h File Reference

#include "gnn_globals.h"

Include dependency graph for gnn_output.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  _gnn_output

Typedefs

typedef _gnn_output gnn_output
 The datatype for outputs.

typedef int(* gnn_output_reset_type )(gnn_output *set)
 The datatype for gnn_output : Writing sets of vectors. reset functions.

typedef int(* gnn_output_put_type )(gnn_output *set, size_t k, const gsl_vector *v)
 The datatype for gnn_output : Writing sets of vectors. get functions.

typedef void(* gnn_output_destroy_type )(gnn_output *set)
 The datatype for gnn_output : Writing sets of vectors. destructor functions.

typedef enum _gnn_output_type gnn_output_type
 Specifies the output device type.


Enumerations

enum  _gnn_output_type { gnnOutputStream, gnnOutputRA }

Functions

int gnn_output_init (gnn_output *set, gnn_output_type mode, size_t size, size_t m, gnn_output_reset_type reset, gnn_output_put_type put, gnn_output_destroy_type destroy)
 Initializes a gnn_output : Writing sets of vectors..

int gnn_output_stream_init (gnn_output *set, gnn_output_reset_type reset, gnn_output_put_type put, gnn_output_destroy_type destroy)
 Initializes a gnn_output : Writing sets of vectors. stream device.

int gnn_output_random_access_init (gnn_output *set, size_t size, size_t m, gnn_output_reset_type reset, gnn_output_put_type put, gnn_output_destroy_type destroy)
 Initializes a gnn_output : Writing sets of vectors. random access device.

void gnn_output_destroy (gnn_output *set)
 Destroy a gnn_output : Writing sets of vectors..

int gnn_output_reset (gnn_output *set)
 Reset a output set.

int gnn_output_put (gnn_output *set, size_t k, const gsl_vector *v)
 Puts the k-th sample.

size_t gnn_output_get_size (gnn_output *set)
 Gets the number of samples in the output.

size_t gnn_output_sample_get_size (gnn_output *set)
 Gets the output sample size.

int gnn_output_is_stream (gnn_output *set)
 Check if stream device.

int gnn_output_is_random_access (gnn_output *set)
 Check if random access device.


Enumeration Type Documentation

enum _gnn_output_type
 

Enumeration values:
gnnOutputStream 
gnnOutputRA 

Definition at line 90 of file gnn_output.h.


Function Documentation

void gnn_output_destroy gnn_output   set
 

This function destroys the output reader.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..

Definition at line 267 of file gnn_output.c.

size_t gnn_output_get_size gnn_output   set
 

This function returns the output set's size. This number normally identifies the number of samples that the output device can handle simultaneously. It corresponds also to the maximum index that can be given in a call at gnn_output_put.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
Returns:
Returns the size.

Definition at line 325 of file gnn_output.c.

int gnn_output_init gnn_output   set,
gnn_output_type    mode,
size_t    size,
size_t    m,
gnn_output_reset_type    reset,
gnn_output_put_type    put,
gnn_output_destroy_type    destroy
 

This function initializes a given vector writer, setting its properties and installing its functions.

If the "reset", or "destroy" functions aren't provided, then the default functions gnn_output : Writing sets of vectors. and gnn_output : Writing sets of vectors. are installed respectively. The "put" function is mandatory, and should always be provided.

As an example, suppose that you have made your own extension to the gnn_output : Writing sets of vectors. datatype, one that writes to a random access file, which you called "my_writer". Also, suppose you have already coded the appropiate "reset", "put" and "destroy" functions for your special writer. Then,

   my_writer *myoutput; // a pointer to the output writer to be created
   gnn_output    *set;  // a pointer to the same structure, but viewed as a
                        // gnn_output

   // allocate memory for the output writer
   myoutput = (my_writer *) malloc (sizeof (my_writer));

   // view as a gnn_output
   set = (gnn_output *) myoutput;

   // initialize the output (you know there are only 100 samples)
   gnn_output_init (set, gnnOutputRA, 100, 5, serial_writer_reset,
                                              serial_writer_get,
                                              serial_writer_destroy);
would initialize your output writer for 100 patterns, whose sample vectors are of size 5.

Please refer also to the alternative functions gnn_output_stream_init and gnn_output_random_access_init.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
mode  Can be gnnOutputStream or gnnOutputRA.
size  The number of samples that it contains.
m  The size of the output samples.
reset  A pointer to the output's "reset" function.
put  A pointer to the output's "put" function.
destroy  A pointer to the output's "destroy" function.
Returns:
0 if succeeded.

Definition at line 162 of file gnn_output.c.

int gnn_output_is_random_access gnn_output   set
 

This function returns 1 if the device is a random access output device.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
Returns:
Returns 1 if the output is a RA device or 0 if not.

Definition at line 380 of file gnn_output.c.

int gnn_output_is_stream gnn_output   set
 

This function returns 1 if the device is a stream device.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
Returns:
Returns 1 if the output is a stream device or 0 if not.

Definition at line 360 of file gnn_output.c.

int gnn_output_put gnn_output   set,
size_t    k,
const gsl_vector *    v
 

This function writes the given vector at the k-th position of the output device.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
k  The index of the sample to be retrieved.
v  A pointer to the vector that should be outputted.
Returns:
Returns 0 if succeeded.

Definition at line 305 of file gnn_output.c.

int gnn_output_random_access_init gnn_output   set,
size_t    size,
size_t    m,
gnn_output_reset_type    reset,
gnn_output_put_type    put,
gnn_output_destroy_type    destroy
 

This function initializes a given random access vector writer, setting its properties and installing its functions. Please refer to gnn_output_init for detailed documentation.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
size  The number of samples that it can contain.
m  The size of the output samples.
reset  A pointer to the output's "reset" function.
put  A pointer to the output's "put" function.
destroy  A pointer to the output's "destroy" function.
Returns:
0 if succeeded.

Definition at line 248 of file gnn_output.c.

int gnn_output_reset gnn_output   set
 

This function resets the output handler.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
Returns:
0 if succeeded.

Definition at line 285 of file gnn_output.c.

size_t gnn_output_sample_get_size gnn_output   set
 

This function returns the size of the output vectors that are written to this output device.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
Returns:
Returns the size.

Definition at line 343 of file gnn_output.c.

int gnn_output_stream_init gnn_output   set,
gnn_output_reset_type    reset,
gnn_output_put_type    put,
gnn_output_destroy_type    destroy
 

This function initializes a given stream vector writer, setting its properties and installing its functions. Please refer to gnn_output_init for detailed documentation.

Parameters:
set  A pointer to a gnn_output : Writing sets of vectors..
reset  A pointer to the output's "reset" function.
put  A pointer to the output's "put" function.
destroy  A pointer to the output's "destroy" function.
Returns:
0 if succeeded.

Definition at line 223 of file gnn_output.c.


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