Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

annie Namespace Reference

Command-line (and possibly config file) parameter handling. More...


Classes

class  AbstractNeuron
 Implementation helper for common types of Neurons. More...

class  ArgParser
class  CenterNeuron
 A center-neuron, the building block of a Radial basis function network. More...

class  DynamicKohonenParameters
class  EucledianTopology
 Standard eucledian topology OPT: zounds. More...

class  Exception
 A common exception class used by all classes in the annie library. More...

class  ExKohonenDraw
class  File
 The idea is that this class will be used to read in information from text files created by the "save" function in various annie classes. More...

class  GABNeuron
 Neuron for Gain Adaptive BP. More...

class  HopfieldBase
 A Hopfield network - content addressable memory and energy. More...

struct  HopfieldBase::NData
class  HopfieldNetwork
 A "standard" incarnation of the Hopfield network usable form most purposes. More...

class  Image
 represents one image (actually a SDL_Context wrapper ..) More...

struct  Image::Color
 the color components should be in [0, 1] More...

class  ImageCompressor
 (usually lossy) image compressor. More...

class  ImageCompressor::PartialListener
class  InputLayer
 A layer of input neurons. More...

class  InputNeuron
 Input neurons are slightly special. More...

class  KohonenAnalyzer
struct  KohonenAnalyzer::Outs
class  KohonenDraw
 Draws examples and progress of the Kohonen clustering using OpenGL --> Should be called from the redraw thread. More...

class  KohonenNetwork
 Todo: getOutput (&& getWin*) doesn't give anything sensible in this impl. More...

class  KohonenNeuron
class  KohonenParameters
 Note: it is closely tied to Topology - the meaning NeighborhoodSize depends on the Topology used. More...

class  Layer
 Abstraction for a "layer" of neurons, i.e., a group of neurons not connected to each other. More...

class  Link
 Abstraction of a connection between two neurons. More...

class  Matrix
 A class for 2-dimensional matrices. More...

class  MLPCompressor
 yeah, yeah - ValueUpdateListener should have been inner class More...

class  MLPKohonenAnalyzer
 Analyzes MLP using Kohonen. More...

class  MultiLayerNetwork
 Abstraction of a multi-layer perceptron network. More...

struct  MultiLayerNetwork::Error
 Error summator will be moved up for general use.. More...

class  Network
 Another core class of the annie library, a generic template for a neural network. More...

class  Neuron
 One of the fundamental annie classes - the basic Neuron. More...

struct  NumberParameter
class  ParametrizedNeuron
 Neuron with a parametrized activation function. More...

class  RadialBasisNetwork
 A Radial Basis Function Neural Network. More...

class  RecurrentNetwork
 RN constructed from a genotype. More...

class  RecurrentNeuron
 A neuron used for recurrent networks. More...

struct  Redrawer
struct  RigidVisualiser
 Simple text-mode visualiser, which prints updated value after each change (synchronous). More...

struct  Selector
 Select features from the TS vectors. More...

struct  Shrinker
struct  Shuffler
 Shuffles the given training set every nth epoch. More...

class  SimpleNeuron
 A simple perceptron - i.e., it takes as input the weighted sum of the outputs of the neurons connected to it. More...

struct  SimpleVisualiser
 Simple text-mode visualiser, which prints updated value after each change (synchronous), it it didn't occur too soon. More...

class  StandardKohonenParameters
 learningParam = e ^ (- slope * ( ln (time) ^ 2 ) ) neighborHoodSize = (MAX_NB_SIZE) * learningParam More...

class  StaticKohonenParameters
 Static kohonen parameters - don't change unless changed by the user. More...

struct  Stepper
 Waits for keypress on each "epoch" if "stepped" is true. More...

struct  StringParameter
 also holds the destination More...

class  TerminatedException
class  TileCompressor
 Compress image by dividing it to squares. More...

class  TLayer
 nice getters... More...

class  Topology
 Class used as a template to the KohonenNetwork network. More...

class  TrainingSet
 This is an abstraction for the set of patterns which are used to "train" a network. More...

struct  TSTransformer
 2 vectors -> 2 vectors More...

class  TwoLayerNetwork
 Two layered networks are very commonly used. More...

class  Vector
class  Video
 Video (and input) system maintaince. More...

class  Video::Redrawer
 User redraw class. draw() will be called from the video thread. More...


Typedefs

typedef double real
 Use this instead of double/float for real numbers pertaining to annie.

typedef real(* TimeSeriesCreatingFunction )(unsigned time)
 Function that can be sampled in discrete time steps.

typedef std::vector< realSamplesContainer
 Store for samples.

typedef real(* SamplingFunction )()
 generates one sample at each call see...

typedef real(* ActivationFunction )(real)
 These functions are used as activation functions of the neurons, i.e., the function applied to the raw output of the neurons.

typedef std::vector< Link * > LINKS
 A set of Links, ie, weighted connections between two neurons.

typedef real(* ParametrizedActivationFunction )(real, real parameter)
typedef TLayer< RecurrentNeuronRecurrentLayer
 implementation detail, don't bother :)

typedef Vector(* XformFunction )(const Vector &in)
 transforms one vector to another.

typedef std::vector< annie::Image * > Images
 container for images

typedef std::vector< realVFather
 A vector of real numbers.


Functions

void parseArgs (int argc, char *argv[], const NumberParameter *numeric, StringParameter *strin)
 shortcut - you don't have to use the ArgParser yourself

char getLastKeyPressed ()
char waitForKey ()
void initControlThread (uint winW=600, uint winH=600)
 also initializes video

void goodbyeControlThread ()
 nicely terminates CT Must be called even if you don't want to terminate the thread prematurely

void changeWindowSize (uint winW, uint winH, bool wait=true)
 change the screen size

void forceRedraw (bool wait=true)
 redraw the screen

VideogetVideo ()
void assert_failed (const char *cond, const char *function, const char *file, int line)
void sampleFunction (TimeSeriesCreatingFunction f, unsigned from, unsigned to, SamplesContainer &out)
 Sample the given function.

TrainingSetmakeExamples (unsigned inputs, unsigned outputs, const SamplesContainer &samples, int from=0, int to=-1)
TrainingSetrandomSamples (uint samples, uint dim, SamplingFunction *samplingFunctions)
 Produce set of points randomly drawn from the N-d cube.

TrainingSetrandomSamples (uint samples, uint dim, SamplingFunction samplingFunction)
 sugar for randomSamples - apply the same sampling function to all dimensions

TrainingSettransformInputs (TrainingSet &source, XformFunction f, uint res_ins) throw ()
 Transform the input component of training examples by given function.

TrainingSettransformInputs (TrainingSet &source, XformFunction f) throw ()
 sugar

Vector toPolar (const Vector &in)
 map input to sphere [0] = r [1] = angle ( <- [0, 1], not radians!!!)

Vector normalize (const Vector &in)
Vector vectorIdentity (const Vector &in)
template<int T_multiplier1000> Vector Xscale (const Vector &in)
 Heck, float cannot be used as a template parameter...

template<int T_add1000> Vector Xadd (const Vector &in)
TrainingSetuniformCube (uint samples, uint dim)
 some shortcuts these are good examples of samplers usage

TrainingSetuniformSphere (uint samples, uint dim)
 each spike is equally covered => center is denser

real isPositive (real x)
 Similar to the signum function, but used for non-bipolar Hopfield networks.

std::ostream & operator<< (std::ostream &o, const Image &i)
std::ostream & operator<< (std::ostream &o, const Image::Color &c)
void runKohonenAnalyzer (KohonenAnalyzer &ka)
real identity (real x)
 The identity function, ie, f(x) = x.

real didentity (real x)
 Derivative of the identity function, thus always returns 1.

real sigmoid (real x)
 Sigmoidal activation f(x).

real dsigmoid (real x)
 Derivative of the sigmoidal function.

real gaussian (real x)
 The guassian function. Sigma is taken to be 1.0.

real dgaussian (real x)
 Derivative of the gaussian function (sigma is taken to be 1.0).

real signum (real x)
 Signum function Returns real instead of int because this function can be used as an activation function too, so wanted to keep the signature the same as other activation functions.

real tansig (real x)
 The tansig activation function. Courtesy Jose Ramos (warta@users.sourceforge.net).

real dtansig (real x)
 Derivative of the tansign activation function. Courtesy Jose Ramos (warta@users.sourceforge.net).

real psigmoid (real x, real lambda)
 Sigmoidal activation with slope modifier lambda f(x) = 1/(1+e^(lambda*x)).

real dpsigmoid (real x, real lambda)
 Derivative of the sigmoidal function.

real uniformRandom (real min, real max)
 returns a number drawn uniformly from min, max

Vector uniformRandomVector (real min, real max, uint size)
real random ()
 Generates a random real number between -1.0 and 1.0.

real random01 ()
 Generates a random real number between 0.0 and 1.0.

int randomInt (int low, int high)
 Generates a random integer between given bounds.

void sysInit ()
 system dependent.

Images makeSubimages (const annie::Image &i, unsigned xSize, unsigned ySize)
TrainingSetmakeSubImageExamples (const Images &outImages, std::vector< Vector > &outExamples)
 make vector from each tile.

void runCompressor (ImageCompressor &ic, const char *image, bool graay=false)
 generic ImageCompressor utilization uses ["input"] as the input file

std::ostream & operator<< (std::ostream &os, const annie::Vector &v)
bool operator== (const Vector &o1, const Vector &o2)

Variables

const real REAL_MAX = std::numeric_limits<double>::max() REAL_MIN=std::numeric_limits<double>::min()
const int BINARY_FILE = 0
 The TrainingSet can be saved as a binary file or a text file, the latter allowing users to create a training set without using annie.

const int TEXT_FILE = 1
const real SIGMOID_APROX_THRESHOLD = 30
SDL_PixelFormat defaultRGBformat
 the only format of surface we create


Detailed Description

Command-line (and possibly config file) parameter handling.

Author:
OP
Id
args.h,v 1.1 2004/06/16 10:53:30 opx Exp


Typedef Documentation

typedef real(* ActivationFunction)(real)
 

These functions are used as activation functions of the neurons, i.e., the function applied to the raw output of the neurons.

See also:
identity

sigmoid

gaussian

typedef std::vector<annie::Image *> Images
 

container for images

typedef std::vector<Link *> LINKS
 

A set of Links, ie, weighted connections between two neurons.

typedef real(* ParametrizedActivationFunction)(real, real parameter)
 

typedef double real
 

Use this instead of double/float for real numbers pertaining to annie.

typedef TLayer<RecurrentNeuron> RecurrentLayer
 

implementation detail, don't bother :)

typedef std::vector< real > SamplesContainer
 

Store for samples.

typedef real(* SamplingFunction)()
 

generates one sample at each call see...

we have random01 :)

typedef real(* TimeSeriesCreatingFunction)(unsigned time)
 

Function that can be sampled in discrete time steps.

typedef std::vector<real> VFather
 

A vector of real numbers.

typedef Vector(* XformFunction)(const Vector &in)
 

transforms one vector to another.

Doesn't have to come up with the same size. look in annie/examples.h for common xform functions


Function Documentation

void assert_failed const char *  cond,
const char *  function,
const char *  file,
int  line
 

void changeWindowSize uint  winW,
uint  winH,
bool  wait = true
 

change the screen size

real dgaussian real  x  ) 
 

Derivative of the gaussian function (sigma is taken to be 1.0).

real didentity real  x  ) 
 

Derivative of the identity function, thus always returns 1.

real dpsigmoid real  x,
real  lambda
 

Derivative of the sigmoidal function.

real dsigmoid real  x  ) 
 

Derivative of the sigmoidal function.

real dtansig real  x  ) 
 

Derivative of the tansign activation function. Courtesy Jose Ramos (warta@users.sourceforge.net).

void forceRedraw bool  wait = true  ) 
 

redraw the screen

real gaussian real  x  ) 
 

The guassian function. Sigma is taken to be 1.0.

char getLastKeyPressed  ) 
 

Video* getVideo  ) 
 

void goodbyeControlThread  ) 
 

nicely terminates CT Must be called even if you don't want to terminate the thread prematurely

real identity real  x  ) 
 

The identity function, ie, f(x) = x.

void initControlThread uint  winW = 600,
uint  winH = 600
 

also initializes video

real isPositive real  x  ) 
 

Similar to the signum function, but used for non-bipolar Hopfield networks.

Parameters:
x A real value
Returns:
0 if x<=0, 1 otherwise.

TrainingSet * makeExamples unsigned  inputs,
unsigned  outputs,
const SamplesContainer &  samples,
int  from = 0,
int  to = -1
 

TrainingSet* makeSubImageExamples const Images &  outImages,
std::vector< Vector > &  outExamples
 

make vector from each tile.

Only the 1st byte of each color component is taken into account (to reduce dimensionalyty for MLP) retuens the outExamples and the same stored as identity in TrainingSet

Images makeSubimages const annie::Image i,
unsigned  xSize,
unsigned  ySize
 

Vector normalize const Vector &  in  ) 
 

std::ostream& operator<< std::ostream &  os,
const annie::Vector v
 

std::ostream& operator<< std::ostream &  o,
const Image::Color &  c
[inline]
 

std::ostream& operator<< std::ostream &  o,
const Image &  i
[inline]
 

Here is the call graph for this function:

bool operator== const Vector &  o1,
const Vector &  o2
 

void parseArgs int  argc,
char *  argv[],
const NumberParameter *  numeric,
StringParameter *  strin
 

shortcut - you don't have to use the ArgParser yourself

real psigmoid real  x,
real  lambda
 

Sigmoidal activation with slope modifier lambda f(x) = 1/(1+e^(lambda*x)).

real random  ) 
 

Generates a random real number between -1.0 and 1.0.

real random01  ) 
 

Generates a random real number between 0.0 and 1.0.

int randomInt int  low,
int  high
 

Generates a random integer between given bounds.

Parameters:
low Lower bound
high Upper bound (exclusively)
Returns:
A random integer i, low<=i<high

TrainingSet* randomSamples uint  samples,
uint  dim,
SamplingFunction  samplingFunction
 

sugar for randomSamples - apply the same sampling function to all dimensions

TrainingSet* randomSamples uint  samples,
uint  dim,
SamplingFunction *  samplingFunctions
 

Produce set of points randomly drawn from the N-d cube.

Each I-O pair will only have the "I" component - dimension of output will be 0. Each dimension is supposed to be a [0, 1] interval This function is useful for Kohonen Maps, for example

Parameters:
samples - how many samples do you want?
samplingFunctions - array [dim] of sample generators for each dimension
Returns:
a newly created training set. Caller is responsible for deletion!!

void runCompressor ImageCompressor &  ic,
const char *  image,
bool  graay = false
 

generic ImageCompressor utilization uses ["input"] as the input file

Parameters:
gray whether to gray the input image before processing

void runKohonenAnalyzer KohonenAnalyzer &  ka  ) 
 

void sampleFunction TimeSeriesCreatingFunction  f,
unsigned  from,
unsigned  to,
SamplesContainer &  out
 

Sample the given function.

real sigmoid real  x  ) 
 

Sigmoidal activation f(x).

real signum real  x  ) 
 

Signum function Returns real instead of int because this function can be used as an activation function too, so wanted to keep the signature the same as other activation functions.

Parameters:
x Real value as input
Returns:
-1 if x<0, +1 if x>=0

void sysInit  ) 
 

system dependent.

May install some goodies like segfault handler, so better call it prior to anything else

real tansig real  x  ) 
 

The tansig activation function. Courtesy Jose Ramos (warta@users.sourceforge.net).

Vector toPolar const Vector &  in  ) 
 

map input to sphere [0] = r [1] = angle ( <- [0, 1], not radians!!!)

actually, the output is scaled to [0, 1] ( .5 + .5 * )

TrainingSet* transformInputs TrainingSet &  source,
XformFunction  f
throw ()
 

sugar

TrainingSet* transformInputs TrainingSet &  source,
XformFunction  f,
uint  res_ins
throw ()
 

Transform the input component of training examples by given function.

TrainingSet* uniformCube uint  samples,
uint  dim
 

some shortcuts these are good examples of samplers usage

real uniformRandom real  min,
real  max
 

returns a number drawn uniformly from min, max

Vector uniformRandomVector real  min,
real  max,
uint  size
[inline]
 

Here is the call graph for this function:

TrainingSet* uniformSphere uint  samples,
uint  dim
 

each spike is equally covered => center is denser

Vector vectorIdentity const Vector &  in  ) 
 

char waitForKey  ) 
 

Vector Xadd const Vector &  in  )  [static]
 

Vector Xscale const Vector &  in  )  [static]
 

Heck, float cannot be used as a template parameter...

probably to decline the piggy things like this one we should use xforming class instead of xforming function (like trhat for mixed i-o's)


Variable Documentation

const int BINARY_FILE = 0
 

The TrainingSet can be saved as a binary file or a text file, the latter allowing users to create a training set without using annie.

A binary file is referred to as annie::BINARY_FILE and a text file as annie::TEXT_FILE

See also:
TrainingSet

TrainingSet::save

TEXT_FILE

SDL_PixelFormat defaultRGBformat
 

the only format of surface we create

const real REAL_MAX = std::numeric_limits<double>::max() REAL_MIN=std::numeric_limits<double>::min()
 

const real SIGMOID_APROX_THRESHOLD = 30
 

const int TEXT_FILE = 1
 

See also:
BINARY_FILE


Generated on Fri Jun 18 13:18:50 2004 for Annie by doxygen 1.3.5