encog/encog-c — pull request #2 by stephencox (2012-05-18 09:35:47+00:00)
Title: Normalise concept

I think we should store the normalising parameters in the network?

Try using:

void print_data(ENCOG_DATA *data){

REAL *input,*ideal;
unsigned long i;
INT j;

for(i=0; irecordCount; i++)
{
printf("\nRecord %d",i);
input = EncogDataGetInput(data,i);
ideal = EncogDataGetIdeal(data,i);

printf("\nInput: ");
for(j=0; jinputCount; j++){
printf("%0.3f ",input[j]);
}

printf("\nIdeal: ");
for(j=0; jidealCount; j++){
printf("%0.3f ",ideal[j]);
}
}
}

int main()
{
ENCOG_DATA *data;
ENCOG_DATA_NORM *norm;

data = EncogDataGenerateRandom(5,2,10,0,10);

printf("\n--------------------------\n");
print_data(data);
printf("\n--------------------------\n");

norm=EncogDataNormalise(data);

printf("\n------------NORMAL--------------\n");
print_data(data);
printf("\n--------------------------\n");

EncogDataDenormalise(data,norm);

printf("\n------------DE-NORMAL--------------\n");
print_data(data);
printf("\n--------------------------\n");

return 0;
}

Signed-off-by: Stephen Cox