Hi,

I'm new to java and currently trying to implement generalized regression neural network (grnn) in java. I need an opinion on how to comparing input with training data from text file.

this is the basic code/algorithm that i use right now:

This is the example of training data that i put in text file.Quote:

public class Grnn {

public static void main(String[] args)

{

// Check LSA, CM and CUT and compare to LSA, CM and CUT in training data,

// Capture Target Output values = TargetOutput

double LSA_Training_Data = 0.8;

int CM_Training_Data = 77;

int CUT_Training_Data = 65;

double LSA = 0.6;

int CM = 76;

int CUT = 64;

double dif1 = LSA_Training_Data - LSA;

int dif2 = CM_Training_Data - CM;

int dif3 = CUT_Training_Data - CUT;

int NoOfNeuron = 3;

int TargetOutput = 75;

double numenator = (((TargetOutput * Math.pow(NoOfNeuron,dif1)) + (TargetOutput * Math.pow(NoOfNeuron,dif2)) + (TargetOutput * Math.pow(NoOfNeuron,dif3))));

double denumenator = (Math.pow(NoOfNeuron,dif1)+ Math.pow(NoOfNeuron,dif2)+ Math.pow(NoOfNeuron,dif3));

double holdtime = (numenator / denumenator);

System.out.println ("hold time is " + holdtime);

System.out.println ("exponent a " + (TargetOutput * Math.pow(NoOfNeuron,dif1)));

System.out.println ("exponent b " + (TargetOutput * Math.pow(NoOfNeuron,dif2)));

System.out.println ("exponent c " + (TargetOutput * Math.pow(NoOfNeuron,dif3)));

}

}

LSA CM CUT Target Output

60 1 1 0.1

55 1 1 0.1

60 33 17 0.2

55 33 17 0.3

60 77 65 47

55 77 65 49

0.8 77 65 75

0.8 81 65 76

0.7 81 65 78

How am i going to compare my input (LSA, CM, CUT) with training data (LSA_Training_Data,CM_Training_Data,CUT_Training_D ata) that i put in text file and also capture the Target Output? The other problem is how am i going to capture the nearest Training Data in file? The input does not always the same with the data in text file. For example the input is can be 0.6(LSA), 76(CM) and 64(CUT) and if you refer to the training data above the nearest value is 0.8,77,65 where the target output is 75 . The use of GRNN is to predict the value of output (hold time) based on this three input (0.6,76,64). The way GRNN works can be seen in the code. As you can see, i manually input the value of LSA, CM, CUT, LSA_Training_Data,CM_Training_Data,CUT_Training_Da ta and Target Output but i need to get this data (LSA_Training_Data,CM_Training_Data,CUT_Training_D ata and Target Output) from text file based from the input (LSA, CM, CUT) that i provide.

Your opinion is very, very much appreciated.