Repository navigation
Expand file tree
/
Copy pathCommonInterface.java
More file actions
46 lines (41 loc) · 1.54 KB
/
Copy pathCommonInterface.java
File metadata and controls
46 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package interfaces;
import java.io.File;
import java.io.IOException;
/**
* This interface is common to both the Neural Net and LUT interfaces.
* The idea is that you should be able to easily switch the LUT
* for the Neural Net since the interfaces are identical.
* @date 20 June 2012
* @author sarbjit
*
*/
public interface CommonInterface {
/**
* @param X The input vector. An array of doubles.
* @return The value returned by the LUT or NN for this input vector
*/
public double outputFor(double [] X);
/**
* This method will tell the NN or the LUT the output
* value that should be mapped to the given input vector. I.e.
* the desired correct output value for an input.
* @param X The input vector
* @param argValue The new value to learn
* @return The error in the output for that input vector
*/
public double train(double [] X, double argValue);
/**
* A method to write either a LUT or weights of a neural net to a file.
* @param argFile of type File.
*/
public void save(File argFile);
/**
* Loads the LUT or neural net weights from file. The load must of course
* have knowledge of how the data was written out by the save method.
* You should raise an error in the case that an attempt is being
* made to load data into an LUT or neural net whose structure does not match
* the data in the file. (e.g. wrong number of hidden neurons).
* @throws IOException
*/
public void load(String argFileName) throws IOException;
}