mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-24 07:36:24 +01:00
Add utils.c
This commit is contained in:
parent
6e4e5f0947
commit
e2e12ca78f
1
make.sh
1
make.sh
@ -44,6 +44,7 @@ if [[ $1 == "test" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "build" ]]; then
|
if [[ $1 == "build" ]]; then
|
||||||
|
mkdir -p "$OUT"
|
||||||
echo "Compilation de src/mnist/main.c"
|
echo "Compilation de src/mnist/main.c"
|
||||||
gcc src/mnist/main.c -o "$OUT/main" $FLAGS
|
gcc src/mnist/main.c -o "$OUT/main" $FLAGS
|
||||||
echo "Fait."
|
echo "Fait."
|
||||||
|
23
src/mnist/utils.c
Normal file
23
src/mnist/utils.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user