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

gnn_input : Reading and handling of sets of vectors.
[Datasets]


Detailed Description

The gnn_input : Reading and handling of sets of vectors. type defines a common interface for vector sets handlers.

gnn_input : Reading and handling of sets of vectors. datatypes are special objects that read and provide access to sets of vectors. The raw gnn_input : Reading and handling of sets of vectors. structure defines a common interface that should be implemented by extensions of this type. Typical implementations can read vectors from files, memory, ports, etc.


Modules

gnn_constant_input : Constant Input Samples.
 Constant Input samples.

gnn_gaussian_noise_input : Adds Gaussian Noise to Input Samples.
 Adds gaussian noise to input samples.

gnn_memory_input : Memory Input Samples.
 Input sample sets that reside in memory.


Typedefs

typedef _gnn_input gnn_input
 The datatype for inputs.

typedef int(* gnn_input_reset_type )(gnn_input *set)
 The datatype for gnn_input : Reading and handling of sets of vectors. reset functions.

typedef const gsl_vector *(* gnn_input_get_type )(gnn_input *set, size_t k)
 The datatype for gnn_input : Reading and handling of sets of vectors. get functions.

typedef void(* gnn_input_destroy_type )(gnn_input *set)
 The datatype for gnn_input : Reading and handling of sets of vectors. destructor functions.


Functions

int gnn_input_default_reset (gnn_input *set)
 Default "reset" function for a input set.

void gnn_input_default_destroy (gnn_input *set)
 Default "destroy" function for a dataset.

int gnn_input_init (gnn_input *set, size_t size, size_t n, gnn_input_reset_type reset, gnn_input_get_type get, gnn_input_destroy_type destroy)
 Initializes a gnn_input : Reading and handling of sets of vectors..

void gnn_input_destroy (gnn_input *set)
 Destroy a gnn_input : Reading and handling of sets of vectors..

int gnn_input_reset (gnn_input *set)
 Reset a input set.

const gsl_vector * gnn_input_get (gnn_input *set, size_t k)
 Gets the k-th sample.

size_t gnn_input_get_size (gnn_input *set)
 Gets the number of samples in the set.

size_t gnn_input_sample_get_size (gnn_input *set)
 Gets the sample's size.


Typedef Documentation

typedef struct _gnn_input gnn_input
 

This is the datatype that contains the basic elements for the implementation of a inputvector reader. Every new type of inputs should extend this structure.

Definition at line 52 of file gnn_input.h.

typedef void(* gnn_input_destroy_type)(gnn_input *set)
 

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

Definition at line 84 of file gnn_input.h.

typedef const gsl_vector*(* gnn_input_get_type)(gnn_input *set, size_t k)
 

This function type defines the form of the "get" functions for input sets. A "get" function should return the k-th pattern. The returned vector is not intended to be modified. The pointed vector should persist until a call on "reset", "get" or "destroy".

Definition at line 75 of file gnn_input.h.

typedef int(* gnn_input_reset_type)(gnn_input *set)
 

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

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

Definition at line 64 of file gnn_input.h.


Function Documentation

void gnn_input_default_destroy gnn_input   set
 

This function is the default "destroy" function for an input set. 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_input : Reading and handling of sets of vectors..

Definition at line 97 of file gnn_input.c.

int gnn_input_default_reset gnn_input   set [static]
 

This function is the default "reset" function for a input set. Actuallly, it doesn't anything.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
Returns:
0 if succeeded.

Definition at line 77 of file gnn_input.c.

void gnn_input_destroy gnn_input   set
 

This function destroys the input reader.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..

Definition at line 207 of file gnn_input.c.

const gsl_vector* gnn_input_get gnn_input   set,
size_t    k
 

This function returns a pointer to a buffer containing the k-th sample vector. The content of the pointed vector will be valid until a next function call on this input set.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
k  The index of the sample to be retrieved.
Returns:
Returns a pointer to a buffer containing the sample vector, or NULL else.

Definition at line 246 of file gnn_input.c.

size_t gnn_input_get_size gnn_input   set
 

This function returns the set's size.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
Returns:
Returns the size.

Definition at line 264 of file gnn_input.c.

int gnn_input_init gnn_input   set,
size_t    size,
size_t    n,
gnn_input_reset_type    reset,
gnn_input_get_type    get,
gnn_input_destroy_type    destroy
 

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

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

As an example, suppose that you have made your own extension to the gnn_input : Reading and handling of sets of vectors. datatype, one that reads from a serial port, which you called "serial_reader". Also, suppose you have already coded the appropiate "reset", "get" and "destroy" functions for your special reader. Then,

   serial_reader *myinput; // a pointer to the input reader to be created
   gnn_input     *set;     // a pointer to the same structure, but viewed as a
                           // gnn_input

   // allocate memory for the input reader
   myinput = (serial_reader *) malloc (sizeof (serial_reader));
   
   // view as a gnn_input
   set = (gnn_input *) myinput;

   // initialize the input (you know there are only 100 samples)
   gnn_input_init (set, 100, 5, serial_reader_reset,
                                serial_reader_get,
                                serial_reader_destroy);
would initialize your input reader for 100 patterns, whose sample vectors are of size 5.
Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
size  The number of samples that it contains.
n  The size of the samples.
reset  A pointer to the input's "reset" function.
get  A pointer to the input's "get" function.
destroy  A pointer to the input's "destroy" function.
Returns:
0 if succeeded.

Definition at line 153 of file gnn_input.c.

int gnn_input_reset gnn_input   set
 

This function resets the input handler.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
Returns:
0 if succeeded.

Definition at line 225 of file gnn_input.c.

size_t gnn_input_sample_get_size gnn_input   set
 

This function returns the size of the samples.

Parameters:
set  A pointer to a gnn_input : Reading and handling of sets of vectors..
Returns:
Returns the size.

Definition at line 281 of file gnn_input.c.


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