UESMANN CPP  1.0
Reference implementation of UESMANN
Classes | Functions
/home/travis/build/jimfinnis/uesmanncpp/data.hpp File Reference

Contains formats for example data. More...

#include <assert.h>
#include <stdint.h>
#include "mnist.hpp"
Include dependency graph for data.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ExampleSet
 A set of example data. Each datum consists of hormone (i.e. modulator value), inputs and outputs. The data is stored as a single double array, with each example made up of inputs, followed by outputs, followed by modulator value (h). More...
 

Functions

template<class T , class TestFunc >
void alternate (T *arr, int nitems, int cycle, TestFunc f)
 Ensure array has cycling values of some function f mod n. Given an array, this function will rearrange the values to ensure that the integer function passed in has values which cycle. For example, if a cycle length of four is specified, the values will be made to run 0,1,2,3,0,1,2,3. This is done in-place. More...
 

Detailed Description

Contains formats for example data.

Definition in file data.hpp.

Function Documentation

template<class T , class TestFunc >
void alternate ( T *  arr,
int  nitems,
int  cycle,
TestFunc  f 
)

Ensure array has cycling values of some function f mod n. Given an array, this function will rearrange the values to ensure that the integer function passed in has values which cycle. For example, if a cycle length of four is specified, the values will be made to run 0,1,2,3,0,1,2,3. This is done in-place.

The input function has the signature (int)(T). In the shuffling code we use it takes a pointer to the data of the example.

Definition at line 26 of file data.hpp.