/****************************************************************************

    Neural Network Library
    Copyright (C) 1998 Daniel Franklin

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.

 ****************************************************************************/

#include <v_lib.h>
#include "neuron.h"

// Sigmoid function. Basically a differentiable threshold function.

vec_t sigmoid (vec_t);

// This class implements a simple three-layer backpropagation network.

class nnwork {
// Initialise with the dimensions of the network (input, hidden, output)
public:
	nnwork (int, int, int);
	nnwork ();
	nnwork (char*);
	~nnwork ();
	
// Training args are input, desired output, minimum error, learning rate

	void train (vec_t [], vec_t [], vec_t, vec_t);

// Run args are input data, output

	void run (vec_t [], vec_t []);
	
// Arg for load and save is just the filename.

	int load (char*);
	int save (char*);

private:
	nnlayer *output_nodes;
	nnlayer *hidden_nodes;
	int input_size;
	int output_size;
	int hidden_size;
};
