Velpus Captiosus
Well-Known Coder
I think I have developed a algorithm to calculate the output of a NN after n epochs of learning ->this link:Expressing the output of a neural network after n iteration as a recursive function
I have written some code:
Output = input * bias and bias = previous desired output - previous output
But I am unsure if it does what the link says also i am confused on the order of the inputs.The program is written on a C++ compiler(VS extension) but it is a .c source file thats why there is the scanf_s() function instead of scanf().
I have written some code:
C:
int input()
{
int x;
printf("Give me the input:\n");
scanf_s("%d", &x);
return x;
}
int desiredOutput(int n)
{
int x;
printf("Give me the desired value of iteration %d:\n",n);
scanf_s("%d", &x);
if (n == 0)
{
return x;
}
else
{
return desiredOutput(n - 1);
}
}
int output(int n)
{
if (n == 0)
{
int b = 0;
printf("The output at iteration n=%d is equal to %d\n", n, b);
return b;
}
else
{
int b = input() * (desiredOutput(n - 1) - output(n - 1));
printf("The output at iteration n=%d is equal to %d\n", n,b);
return b;
}
}
int main()
{
output(2);
return 0;
}
Output = input * bias and bias = previous desired output - previous output
But I am unsure if it does what the link says also i am confused on the order of the inputs.The program is written on a C++ compiler(VS extension) but it is a .c source file thats why there is the scanf_s() function instead of scanf().