Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-linear regression #48

Open
ScratchyCode opened this issue Feb 27, 2021 · 1 comment
Open

Non-linear regression #48

ScratchyCode opened this issue Feb 27, 2021 · 1 comment

Comments

@ScratchyCode
Copy link

ScratchyCode commented Feb 27, 2021

I'm not skilled with machine learning and i'm trying to study its practical applications.
I'm trying to use an ANN for non-linear regression of function sin(x) with analitical points and i have found some problems.

Creating an ANN with 10 hidden layers and 4 neurons, running a for-cycle 1 million times over 100 points maked with x values evenly distributed between 0 and 2pi i obtain this:

alt text

with this specs once created the ANN: ann->activation_output = genann_act_linear;
and the output doesn't change trying to make different ANN.

Someone can help me to understand where i'm wrong (also teoretically)?
I've seen that sigmoid activation function is not the best choice for this purpose like relu, but it's just this?

@ScratchyCode
Copy link
Author

Following the examples of repository my implementation is (most relevant piece of code):

genann *ann = genann_init(INPUT,LAYER,NEURONS,OUTPUT);
ann->activation_output = genann_act_linear;

// training
for(i=0; i<EPOCH; i++){
    for(j=0; j<lenfile; j++){
        genann_train(ann,input+j,output+j,RATE);
    }
}

// first NUMTEST values of dataset
printf("Test on dataset values:\n");
for(i=0; i<NUMTEST; i++){
    printf("f(%lf) = %lf \tresidue = %lf\n",input[i],*genann_run(ann,input + i),output[i] - *genann_run(ann,input + i));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant