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

gnn_dataset.h File Reference

#include "gnn_globals.h"
#include "gnn_input.h"

Include dependency graph for gnn_dataset.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_dataset

Typedefs

typedef _gnn_dataset gnn_dataset
 The datatype for dataset reset functions.

typedef int(* gnn_dataset_reset_type )(gnn_dataset *set)
 The datatype for dataset reset functions.

typedef int(* gnn_dataset_get_type )(gnn_dataset *set, size_t k, gsl_vector **x, gsl_vector **t, double *p)
 The datatype for dataset get functions.

typedef void(* gnn_dataset_destroy_type )(gnn_dataset *set)

Functions

int gnn_dataset_init (gnn_dataset *set, size_t size, size_t n, size_t m, gnn_dataset_reset_type reset, gnn_dataset_get_type get, gnn_dataset_destroy_type destroy)
 Initializes a gnn_dataset : Datasets for Training..

void gnn_dataset_destroy (gnn_dataset *set)
 Destroy a dataset.

int gnn_dataset_reset (gnn_dataset *set)
 Reset a dataset.

int gnn_dataset_get (gnn_dataset *set, size_t k, gsl_vector **x, gsl_vector **t, double *p)
 Gets the i-th pattern.

size_t gnn_dataset_get_size (gnn_dataset *set)
 Gets the size of the dataset.

size_t gnn_dataset_input_get_size (gnn_dataset *set)
 Gets the input size of the dataset.

size_t gnn_dataset_output_get_size (gnn_dataset *set)
 Gets the output size of the dataset.


Typedef Documentation

typedef void(* gnn_dataset_destroy_type)(gnn_dataset *set)
 

Definition at line 79 of file gnn_dataset.h.


Function Documentation

void gnn_dataset_destroy gnn_dataset   set
 

This function destroys the dataset.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..

Definition at line 318 of file gnn_dataset.c.

int gnn_dataset_get gnn_dataset   set,
size_t    k,
gsl_vector **    x,
gsl_vector **    t,
double *    weight
 

This function returns pointers to the pattern located atstores the dataset's i-th pattern into the buffers "x" and "t" (which should be both gsl_vector of the correct size) and its corresponding weight into the location pointed by "weight".

Note that what "the i-th pattern" means depends on the underlying implementation. Also, i should be within 0 and the dataset's size.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
i  The index of the pattern to be retrieved.
x  A pointer to the gsl_vector where the input pattern should be placed in.
t  A pointer to the gsl_vector where the output pattern should be placed in.
weight  A pointer to a double where the pattern's weight should be placed in.
Returns:
0 if succeeded.

Definition at line 365 of file gnn_dataset.c.

size_t gnn_dataset_get_size gnn_dataset   set
 

This function returns the dataset's size.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
Returns:
Returns the size.

Definition at line 386 of file gnn_dataset.c.

int gnn_dataset_init gnn_dataset   set,
size_t    size,
size_t    n,
size_t    m,
gnn_dataset_reset_type    reset,
gnn_dataset_get_type    get,
gnn_dataset_destroy_type    destroy
 

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

If the reset or destroy functions aren't provided, then the default functions gnn_dataset : Datasets for Training. and gnn_dataset : Datasets for Training. are installed respectively. The "get" function is mandatory and can't be omitted.

As an example, suppose that you have made your own extension to the gnn_dataset : Datasets for Training. datatype, which you called "my_dataset_type". Also, suppose you have already coded the appropiate "reset", "get" and "destroy" functions for your special dataset. Then,

   my_dataset_type *myset; // a pointer to the dataset to be created
   gnn_dataset     *set;   // a pointer to the same dataset, but viewed as a
                           //     gnn_dataset
   
   // allocate memory for the dataset
   myset = (my_dataset_type *) malloc (sizeof (my_dataset_type));
 
   // initialize the dataset
   gnn_dataset_init (set, 100, 5, 2,
                     my_dataset_reset, my_dataset_get, my_dataset_destroy);
would initialize your dataset for 100 patterns, whose inputs and outputs are of size 5 and 2 respectivelly.
Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
size  The number of patterns that it contains.
n  The size of the inputs.
m  The size of the outputs.
reset  A pointer to the dataset's "reset" function.
get  A pointer to the dataset's "get" function.
destroy  A pointer to the dataset's "destroy" function.
Returns:
0 if succeeded.

Definition at line 273 of file gnn_dataset.c.

size_t gnn_dataset_input_get_size gnn_dataset   set
 

This function returns the size of the pattern's input vector size.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
Returns:
Returns the size.

Definition at line 403 of file gnn_dataset.c.

size_t gnn_dataset_output_get_size gnn_dataset   set
 

This function returns the size of the pattern's output vector size.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
Returns:
Returns the size.

Definition at line 420 of file gnn_dataset.c.

int gnn_dataset_reset gnn_dataset   set
 

This function resets the dataset.

Parameters:
set  A pointer to a gnn_dataset : Datasets for Training..
Returns:
0 if succeeded.

Definition at line 336 of file gnn_dataset.c.


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