Updating/Adding functions

This commit is contained in:
Abdel Kader Chabi Sika Boni 2021-11-27 21:24:48 +01:00
parent 048e1cee61
commit 04539de3f0
6 changed files with 25 additions and 4 deletions

13
activations.c Normal file
View 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
View 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
View file

@ -11,9 +11,10 @@ int main(int argc, char *argv[])
printf("Bonjour et bienvenu ;)\n");
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));
}
}*/
return 0;
}

View file

@ -5,8 +5,8 @@ typedef struct network Network;
struct 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
int number_layers; //keeps track of layers' number
//Neuron *layers_last_neurons; //last neuron of each layer of the network
int *neurons_per_layer; //keeps track of number of layers' neurons
};
Neuron *generate_layer(int n_neurons, int n_neurons_prev_layer);

0
training.c Normal file
View file

0
training.h Normal file
View file