Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Arnaud Kress
easea
Commits
ac644472
Commit
ac644472
authored
Dec 02, 2010
by
Ogier Maitre
Browse files
Debug CComLayer.
parent
01705daf
Changes
4
Hide whitespace changes
Inline
Side-by-side
dev/c4.5_geo/card.ez
View file @
ac644472
...
...
@@ -150,7 +150,7 @@ float pMutDesThre = 0.5;
struct base* t1 = NULL;
struct base* t2 = NULL;
float* uniq_instances[2];
//
float* uniq_instances[2];
float* mutation_step;
unsigned uniq_cnt[2];
...
...
@@ -168,6 +168,8 @@ GenomeClass {
\Before everything else function:
{
srand(globalRandomGenerator->get_seed());
INSTEAD_EVAL_STEP = true;
...
...
@@ -182,10 +184,10 @@ GenomeClass {
for( unsigned i=0 ; i<t1->hdr->attributes[t1->hdr->whichis_class]->no_values; i++ )
printf("%s : %d\n",t1->hdr->attributes[t1->hdr->whichis_class]->values[i],t1->class_repartition[i]);
uniq_instances[0] = ba_compute_uniq_values(t2, 1, uniq_cnt+0);
uniq_instances[1] = ba_compute_uniq_values(t2, 2, uniq_cnt+1);
//
uniq_instances[0] = ba_compute_uniq_values(t2, 1, uniq_cnt+0);
//
uniq_instances[1] = ba_compute_uniq_values(t2, 2, uniq_cnt+1);
printf("%d %d\n",uniq_cnt[0],uniq_cnt[1]);
//
printf("%d %d\n",uniq_cnt[0],uniq_cnt[1]);
// allocating K packets
generate_k_fold(K,packets_size,t1,k_tables,t2);
...
...
@@ -239,6 +241,32 @@ GenomeClass {
delete mins;
delete maxs;
printf("%d\n",setVariable("u3",0));
if( setVariable("u3",0) ){
FILE* f = fopen("out/out.t","r");
char* indiv_text = (char*)malloc(sizeof(*indiv_text)*512);
fgets(indiv_text,512,f);
printf("%s\n",indiv_text);
fclose(f);
IndividualImpl i;
string* st = new string(indiv_text);
i.deserialize(*st);
delete st;
free(indiv_text);
float fit = i.evaluate();
cTreeNode* root = generate_tree(i.x,t1,t2,GENOME_SIZE,GENE_SIZE);
struct base* tmp_table = table_from_genome(i.x,t1,t2,GENOME_SIZE,GENE_SIZE);
root->compute_coverage(tmp_table);
show_tree(tmp_table,root);
printf("fitness of loaded individual is %f\n",fit);
exit(-1);
}
}
\end
...
...
@@ -261,6 +289,7 @@ GenomeClass {
cTreeNode* root = generate_tree(best->x,t1,t2,GENOME_SIZE,GENE_SIZE);
struct base* tmp_table = table_from_genome(best->x,t1,t2,GENOME_SIZE,GENE_SIZE);
root->compute_coverage(tmp_table);
show_tree(tmp_table,root);
ba_to_arff(tmp_table,"best_table.arff");
...
...
@@ -279,6 +308,8 @@ GenomeClass {
#endif
FILE* f = fopen("out/out.t","w");
fprintf(f,"%s",best->serialize().c_str());
struct base* k_tables_f[10];
unsigned packets_size_f[10];
...
...
@@ -293,6 +324,7 @@ GenomeClass {
}
\end
\GenomeClass::initialiser :
{
for( unsigned i=0; i<GENOME_SIZE ; i+=GENE_SIZE ) {
...
...
@@ -474,7 +506,6 @@ GenomeClass {
// then delete tmp tables
ba_partial_copy_delete(tmp_learning_table);
ba_partial_copy_delete(tmp_test_table);
}
fitness_value = (((float)error) / t1->no_instances)*100;// + (((float)tree_size)/K);
...
...
@@ -509,10 +540,10 @@ LDFLAGS+= -lpq -lm -fopenmp ../c4.5_common/libc45.a $(LIBANTLR_DIR)/.libs/liba
Elitism: Strong //Weak or Strong
Elite: 1
Print stats:
1
//Default: 1
Generate csv stats file:
0
Generate gnuplot script:
0
Generate R script:
0
Plot stats:
0
//Default: 0
Print stats:
true
//Default: 1
Generate csv stats file:
true
Generate gnuplot script:
false
Generate R script:
false
Plot stats:
false
//Default: 0
\end
examples/rastrigin/rastrigin.ez
View file @
ac644472
...
...
@@ -17,7 +17,7 @@ __________________________________________________________*/
#define PI 3.141592654
float pMutPerGene=0.
1
;
float pMutPerGene=0.
3
;
\end
...
...
@@ -146,10 +146,10 @@ CPPFLAGS+=
\end
\Default run parameters : // Please let the parameters appear in this order
Number of generations :
100
// NB_GEN
Time limit: 0 // In seconds, 0 to deactivate
Population size :
200
0 //POP_SIZE
Offspring size :
160
0 // 40%
Number of generations :
9999999
// NB_GEN
Time limit:
6
0 // In seconds, 0 to deactivate
Population size :
384
0 //POP_SIZE
Offspring size :
384
0 // 40%
Mutation probability : 1 // MUT_PROB
Crossover probability : 1 // XOVER_PROB
Evaluator goal : minimise // Maximise
...
...
@@ -163,15 +163,15 @@ CPPFLAGS+=
Elitism: Strong //Weak or Strong
Elite: 1
Print stats:true //Default: 1
Generate csv stats file:
fals
e
Generate csv stats file:
tru
e
Generate gnuplot script:false
Generate R script:false
Plot stats:false //Default: 0
Remote island model:
tru
e
Remote island model:
fals
e
IP file: ip.txt //File containing all the remote island's IP
Save population:
tru
e
Save population:
fals
e
Start from file:false
\end
libeasea/CComUDPLayer.cpp
View file @
ac644472
...
...
@@ -127,7 +127,7 @@ bool isLocalMachine(const char* address){
inet_pton
(
AF_INET
,
address
,
&
ipv4addr
);
he
=
gethostbyaddr
(
&
ipv4addr
,
sizeof
ipv4addr
,
AF_INET
);
//printf("Host name:%s\n",he->h_name);
if
(
strlen
(
hostname
)
<
strlen
(
he
->
h_name
))
size
=
strlen
(
hostname
);
else
...
...
tpl/CUDA.tpl
View file @
ac644472
...
...
@@ -665,11 +665,6 @@ LIBAESAE=$(EZ_PATH)libeasea/
CXXFLAGS
+=
-g
-Wall
-O2
-I
$(
LIBAESAE
)
include
-I
$(
EZ_PATH
)
boost
LDFLAGS=
$(EZ_PATH)boost/program_options.a
$(
LIBAESAE
)
libeasea.a
-lpthread
#USER
MAKEFILE
OPTIONS
:
\
INSERT_MAKEFILE_OPTION#END
OF
USER
MAKEFILE
OPTIONS
CPPFLAGS
+=
-I
$(
LIBAESAE
)
include
-I
$(
EZ_PATH
)
boost
NVCCFLAGS
+=
--compiler-options
-fpermissive
EASEA_SRC=
EASEAIndividual.cpp
...
...
@@ -683,6 +678,13 @@ CUDA_SRC = EASEAIndividual.cu
HDR=
$(EASEA_HDR)
$(
EASEA_UC_HDR
)
OBJ=
$(EASEA_SRC:.cpp=.o)
$
(EASEA_MAIN_HDR:.cpp=
.o)
#USER
MAKEFILE
OPTIONS
:
\
INSERT_MAKEFILE_OPTION#END
OF
USER
MAKEFILE
OPTIONS
CPPFLAGS
+=
-I
$(
LIBAESAE
)
include
-I
$(
EZ_PATH
)
boost
NVCCFLAGS
+=
--compiler-options
-fpermissive
BIN=
EASEA
all:
$(
BIN
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment