From e2e12ca78f978979ceca8781cabe9a278e809f33 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Tue, 19 Apr 2022 13:55:08 +0200 Subject: [PATCH] Add utils.c --- make.sh | 1 + src/mnist/utils.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/mnist/utils.c diff --git a/make.sh b/make.sh index 9d9224f..6e2dc99 100755 --- a/make.sh +++ b/make.sh @@ -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." diff --git a/src/mnist/utils.c b/src/mnist/utils.c new file mode 100644 index 0000000..dcc649a --- /dev/null +++ b/src/mnist/utils.c @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +#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; +} \ No newline at end of file