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

gnn_output : Writing sets of vectors.
[Datasets]


Detailed Description

The gnn_output : Writing sets of vectors. type defines a common interface for vector sets output handlers.

gnn_output : Writing sets of vectors. datatypes are special objects that write vector samples to output devices. The raw gnn_output : Writing sets of vectors. structure defines a common interface that should be implemented by extensions of this type. Typical implementations can write vectors to files, memory, ports, etc.

There are two types of output devices: stream and random access. Stream devices do print to an output stream without carying about the sample and set size. In contrast, random access devices have a defined sample and set size.


Modules

gnn_filewriter : File Output Device.
 Writes outputs sequentially to a file.

gnn_memory_output : Memory Output Samples.
 Output sample sets that reside in memory.

gnn_null_output : Null Output Device.
 Null output device.


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.


Functions

int gnn_output_default_reset (gnn_output *set)
 Default "reset" function for a ouput writer.

void gnn_output_default_destroy (gnn_output *set)
 Default "destroy" function for an output.

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.


Typedef Documentation

typedef struct _gnn_output gnn_output
 

This is the datatype that contains the basic elements for the implementation of a output vector writer. Every new type of outputs should extend this structure.

Definition at line 50 of file gnn_output.h.

typedef void(* gnn_output_destroy_type)(gnn_output *set)
 

This function type defines the form of the "destroy" functions for output writers. It should deallocate the extension's specific data.

Definition at line 82 of file gnn_output.h.

typedef int(* gnn_output_put_type)(gnn_output *set, size_t k, const gsl_vector *v)
 

This function type defines the form of the "put" functions for output sets. A "put" function should save/store the k-th output sample and return 0 if suceeded.

Definition at line 72 of file gnn_output.h.

typedef int(* gnn_output_reset_type)(gnn_output *set)
 

This function type defines the form of the "reset" functions for output sets. A "reset" function should prepare the internal properties for beginning a new sequence of output pattern writings.

"reset" is usually called after the end of an epoch has been reached.

Definition at line 62 of file gnn_output.h.

typedef enum _gnn_output_type gnn_output_type
 

Definition at line 88 of file gnn_output.h.


Function Documentation

void gnn_output_default_destroy gnn_output   set
 

This function is the default "destroy" function for an output. It assumes that there isn't any additional data for the specific dataset type, so it actually just returns.

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

Definition at line 102 of file gnn_output.c.

int gnn_output_default_reset gnn_output   set [static]
 

This function is the default "reset" function for an output set. It does nothing.

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

Definition at line 82 of file gnn_output.c.

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 : Writing sets of vectors..

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 : Writing sets of vectors. and gnn_output : Writing sets of vectors..

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 : Writing sets of vectors. 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 : Writing sets of vectors. 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:43 2004 for libgnn Gradient Retropropagation Machine Library by doxygen1.2.18