/* -*- Mode: C++; -*- */ // VER: $Id: ANN.h,v 1.3 2005/08/05 09:02:57 berniw Exp $ // copyright (c) 2004 by Christos Dimitrakakis /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef ANN_H #define ANN_H #include #include #include #include #include #include #include #include /** \file ANN.h \brief A neural network implementation. A neural network is a parametric function composed of a number of 'layers'. Each layer can be expressed as a function \f$g(y) =g(\sum_i w_i f_i (x))\f$, where the \f$w\f$ are a set of weights and \f$f(\cdot)\f$ is a set of basis functions. The basis functions can be fixed or they can be another layer. The neural network can be adapted to minimise some cost criterion \f$C\f$ (defined on some data) via gradient descent. The gradient of the cost with respect to the data is \f$\partial C/\partial x\f$. By expanding this with the chain rule, we have: \f$\partial C/\partial x = \partial g/\partial y \partial y/\partial w \partial w/\partial x\f$. */ /** \brief A linear connection between two neural elements. It is used to express the sum weights in \f$y = \sum_i w_i f_i (x)\f$. This type of connection currently also supports eligibility traces gradient descent updates, batch updates and variance estimates. */ typedef struct Connection_ { int c; ///< connected? real w; ///< weight real dw; ///< Weight-change real e; ///< eligibility; real v; ///