diff --git a/neuron_t/Makefile b/neuron_t/Makefile index 950c65f..d40ab27 100644 --- a/neuron_t/Makefile +++ b/neuron_t/Makefile @@ -9,12 +9,13 @@ YTESTDIR=$(ROOTPROJECTDIR)/ytest_t YPERMDIR=$(ROOTPROJECTDIR)/ypermutation_t TENSDIR=$(ROOTPROJECTDIR)/tensor_t +LISTDIR=$(ROOTPROJECTDIR)/list_t NEURODIR=$(ROOT_DIR) DIMDIR=$(ROOTPROJECTDIR)/dimension_t #CFLAGS=-I$(INCLUDE_DIR) -I$(YPERMDIR)/src -I$(YTESTDIR)/include_ytest/include -I$(DIMDIR)/src -I$(TENSDIR)/src #"-D DEBUG=1" -INCLUDE=-I$(NEURODIR)/src -I$(YPERMDIR)/src -I$(DIMDIR)/src -I$(TENSDIR)/src #"-D DEBUG=1" +INCLUDE=-I$(NEURODIR)/src -I$(YPERMDIR)/src -I$(DIMDIR)/src -I$(TENSDIR)/src -I$(LISTDIR)/src #"-D DEBUG=1" #LDFLAGS=-L$(YTESTDIR) -lytest -lOpenCL -lm -lpthread #CFLAGS= -Wall -Werror -fpic $(INCLUDE) CFLAGS= -Wall -Werror -fpic $(INCLUDE) diff --git a/neuron_t/src/neuron_t/neuron_t.c b/neuron_t/src/neuron_t/neuron_t.c index ccca61d..7e0d3cc 100644 --- a/neuron_t/src/neuron_t/neuron_t.c +++ b/neuron_t/src/neuron_t/neuron_t.c @@ -1033,7 +1033,15 @@ size_t learning_cloneuronset_##type(cloneuronset_##type *clnrnst, data_set_##typ return nbreps;\ } \ \ - +\ +GEN_LIST_ALL(ptr_set_NEURONS_##type)\ +GEN_FUNC_PTR_LIST_FREE(ptr_set_NEURONS_##type){\ + ptr_set_NEURONS_##type p_s_nn = (struct set_neurons_##type *)arg;\ + free_config_layers(p_s_nn->pconf);\ + free_neurons_##type(p_s_nn->base);\ + free(p_s_nn);\ +}\ +\ diff --git a/neuron_t/src/neuron_t/neuron_t.h b/neuron_t/src/neuron_t/neuron_t.h index 77595ff..ce0119f 100644 --- a/neuron_t/src/neuron_t/neuron_t.h +++ b/neuron_t/src/neuron_t/neuron_t.h @@ -7,6 +7,7 @@ //#include "tools_t/tools_t.h" #include "tensor_t/tensor_t.h" +#include "list_t/list_t.h" extern bool randomizeInitWeight; @@ -124,6 +125,20 @@ typedef struct cloneuronset_##type cloneuronset_##type;\ void free_cloneuronset_##type(cloneuronset_##type *clnrnst);\ cloneuronset_##type * create_cloneuronset_from_base_conf_##type(neurons_##type *base, config_layers *conf, size_t nb_clone);\ size_t learning_cloneuronset_##type(cloneuronset_##type *clnrnst, data_set_##type *dataset, bool (*condition)(type, size_t));\ +\ +\ +\ +struct set_neurons_##type{\ + struct config_layers *pconf;\ + struct neurons_##type *base;\ + ssize_t score;\ +};\ +typedef struct set_neurons_##type * ptr_set_NEURONS_##type;\ +\ +GENERATE_LIST_ALL(ptr_set_NEURONS_##type)\ +GEN_HEAD_PTR_LIST(ptr_set_NEURONS_##type)\ +\ + GEN_NEURON_(TYPE_FLOAT) GEN_NEURON_(TYPE_DOUBLE) diff --git a/neuron_t/src/neuron_t/nneuron_t_file.h b/neuron_t/src/neuron_t/nneuron_t_file.h index c3c6723..4b21087 100644 --- a/neuron_t/src/neuron_t/nneuron_t_file.h +++ b/neuron_t/src/neuron_t/nneuron_t_file.h @@ -443,8 +443,12 @@ j=0;\ if(dim) free_dimension(dim);\ if(l_p) free_list_perm_in_dim(l_p);\ \ -}while(0); - +}while(0);\ +\ +\ +\ +\ +\