2022-10-04 12:43:37 +02:00
|
|
|
#include "struct.h"
|
|
|
|
|
2022-10-01 17:53:14 +02:00
|
|
|
#ifndef DEF_TRAIN_H
|
|
|
|
#define DEF_TRAIN_H
|
|
|
|
|
|
|
|
#define EPOCHS 10
|
|
|
|
#define BATCHES 100
|
|
|
|
#define USE_MULTITHREADING
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure donnée en argument à la fonction 'train_thread'
|
|
|
|
*/
|
|
|
|
typedef struct TrainParameters {
|
|
|
|
Network* network;
|
|
|
|
int*** images;
|
|
|
|
unsigned int* labels;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int dataset_type;
|
|
|
|
char* data_dir;
|
|
|
|
int start;
|
|
|
|
int nb_images;
|
|
|
|
float accuracy;
|
|
|
|
} TrainParameters;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fonction auxiliaire d'entraînement destinée à être exécutée sur plusieurs threads à la fois
|
|
|
|
*/
|
|
|
|
void* train_thread(void* parameters);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fonction principale d'entraînement du réseau neuronal convolutif
|
|
|
|
*/
|
|
|
|
void train(int dataset_type, char* images_file, char* labels_file, char* data_dir, int epochs, char* out);
|
|
|
|
|
|
|
|
#endif
|