Updating/Adding functions
This commit is contained in:
parent
048e1cee61
commit
04539de3f0
6 changed files with 25 additions and 4 deletions
13
activations.c
Normal file
13
activations.c
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
float sigmoid(float weighted_sum)
|
||||||
|
{
|
||||||
|
return 1.0 / (1 + exp(-(float)weighted_sum));
|
||||||
|
}
|
||||||
|
|
||||||
|
float sigmoid_derivative(float output)
|
||||||
|
{
|
||||||
|
return 1.0;
|
||||||
|
}
|
7
activations.h
Normal file
7
activations.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef ACTIVATIONS_H
|
||||||
|
#define ACTIVATIONS_H
|
||||||
|
|
||||||
|
float sigmoid(float weighted_sum);
|
||||||
|
float sigmoid_derivative(float output)
|
||||||
|
|
||||||
|
#endif
|
5
main.c
5
main.c
|
@ -11,9 +11,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
printf("Bonjour et bienvenu ;)\n");
|
printf("Bonjour et bienvenu ;)\n");
|
||||||
int i;
|
int i;
|
||||||
for(i=1 ; i<= 30 ; i++)
|
/*for(i=1 ; i<= 30 ; i++)
|
||||||
{
|
{
|
||||||
printf("%dth generated fload = %f\n", i, random_float(0.0 , 1.0));
|
printf("%dth generated fload = %f\n", i, random_float(0.0 , 1.0));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -5,8 +5,8 @@ typedef struct network Network;
|
||||||
struct network
|
struct network
|
||||||
{
|
{
|
||||||
Neuron *layers_first_neurons; //first neuron of each layer of the network
|
Neuron *layers_first_neurons; //first neuron of each layer of the network
|
||||||
Neuron *layers_last_neurons; //last neuron of each layer of the network
|
//Neuron *layers_last_neurons; //last neuron of each layer of the network
|
||||||
int number_layers; //keeps track of layers' number
|
int *neurons_per_layer; //keeps track of number of layers' neurons
|
||||||
};
|
};
|
||||||
|
|
||||||
Neuron *generate_layer(int n_neurons, int n_neurons_prev_layer);
|
Neuron *generate_layer(int n_neurons, int n_neurons_prev_layer);
|
||||||
|
|
0
training.c
Normal file
0
training.c
Normal file
0
training.h
Normal file
0
training.h
Normal file
Loading…
Reference in a new issue