1 | /* |
---|
2 | * This program is free software; you can redistribute it and/or modify |
---|
3 | * it under the terms of the GNU General Public License as published by |
---|
4 | * the Free Software Foundation; either version 2 of the License, or |
---|
5 | * (at your option) any later version. |
---|
6 | * |
---|
7 | * This program is distributed in the hope that it will be useful, |
---|
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | * GNU General Public License for more details. |
---|
11 | * |
---|
12 | * You should have received a copy of the GNU General Public License |
---|
13 | * along with this program; if not, write to the Free Software |
---|
14 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
15 | */ |
---|
16 | |
---|
17 | /* |
---|
18 | * NeuralMethod.java |
---|
19 | * Copyright (C) 2001 University of Waikato, Hamilton, New Zealand |
---|
20 | */ |
---|
21 | |
---|
22 | |
---|
23 | package weka.classifiers.functions.neural; |
---|
24 | |
---|
25 | import java.io.Serializable; |
---|
26 | |
---|
27 | /** |
---|
28 | * This is an interface used to create classes that can be used by the |
---|
29 | * neuralnode to perform all it's computations. |
---|
30 | * |
---|
31 | * @author Malcolm Ware (mfw4@cs.waikato.ac.nz) |
---|
32 | * @version $Revision: 1.6 $ |
---|
33 | */ |
---|
34 | public interface NeuralMethod extends Serializable { |
---|
35 | |
---|
36 | /** |
---|
37 | * This function calculates what the output value should be. |
---|
38 | * @param node The node to calculate the value for. |
---|
39 | * @return The value. |
---|
40 | */ |
---|
41 | double outputValue(NeuralNode node); |
---|
42 | |
---|
43 | /** |
---|
44 | * This function calculates what the error value should be. |
---|
45 | * @param node The node to calculate the error for. |
---|
46 | * @return The error. |
---|
47 | */ |
---|
48 | double errorValue(NeuralNode node); |
---|
49 | |
---|
50 | /** |
---|
51 | * This function will calculate what the change in weights should be |
---|
52 | * and also update them. |
---|
53 | * @param node The node to update the weights for. |
---|
54 | * @param learn The learning rate to use. |
---|
55 | * @param momentum The momentum to use. |
---|
56 | */ |
---|
57 | void updateWeights(NeuralNode node, double learn, double momentum); |
---|
58 | |
---|
59 | } |
---|