Add utils.c

This commit is contained in:
augustin64 2022-04-19 13:55:08 +02:00
parent 6e4e5f0947
commit e2e12ca78f
2 changed files with 24 additions and 0 deletions

View File

@ -44,6 +44,7 @@ if [[ $1 == "test" ]]; then
fi
if [[ $1 == "build" ]]; then
mkdir -p "$OUT"
echo "Compilation de src/mnist/main.c"
gcc src/mnist/main.c -o "$OUT/main" $FLAGS
echo "Fait."

23
src/mnist/utils.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include "neural_network.c"
#include "neuron_io.c"
void print_biais(char* filename) {
Reseau* reseau = lire_reseau(".cache/reseau.bin");
for (int i=0; i < reseau->nb_couches; i++) {
printf("Couche %d\n", i);
for (int j=0; j < reseau->couches[i]->nb_neurones; j++) {
printf("Couche %d\tNeurone %d\tBiais: %0.1f\n", i, j, reseau->couches[i]->neurones[j]->biais);
}
}
}
int main(int argc, int* argv) {
print_biais(".cache/reseau.bin");
return 1;
}