Skip to content
Snippets Groups Projects
Commit 7aed1323 authored by Jeremy Auguste's avatar Jeremy Auguste
Browse files

Started working on cff2fann

parent ebabce6b
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ void cff2fann(context *ctx) ...@@ -54,6 +54,7 @@ void cff2fann(context *ctx)
mcd *m = ctx->mcd_struct; mcd *m = ctx->mcd_struct;
FILE *f = myfopen(ctx->input_filename, "r"); FILE *f = myfopen(ctx->input_filename, "r");
int val; int val;
dico *vocab;
while(fgets(buffer, 10000, f)){ while(fgets(buffer, 10000, f)){
/* printf("%s", buffer); */ /* printf("%s", buffer); */
...@@ -63,8 +64,10 @@ void cff2fann(context *ctx) ...@@ -63,8 +64,10 @@ void cff2fann(context *ctx)
while(token){ while(token){
/* printf("col = %d token = %s max = %d\n", col_nb, token, max_array[col_nb]); */ /* printf("col = %d token = %s max = %d\n", col_nb, token, max_array[col_nb]); */
val = atoi(token); val = atoi(token);
vocab = dico_vec_get_dico(ctx->vocabs, "d_perceptron_features");
printf("!!! %s\n", dico_int2string(vocab, val));
if(col_nb == 0){ if(col_nb == 0){
one_hot_print(stdout, val, ctx->mvt_nb); one_hot_print(stderr, val, ctx->mvt_nb);
printf("\n"); printf("\n");
} }
else{ else{
...@@ -74,12 +77,12 @@ void cff2fann(context *ctx) ...@@ -74,12 +77,12 @@ void cff2fann(context *ctx)
/* printf("representation = %d\n", m->representation[mcd_col]); */ /* printf("representation = %d\n", m->representation[mcd_col]); */
if(m->representation[mcd_col] == MCD_REPRESENTATION_EMB){ if(m->representation[mcd_col] == MCD_REPRESENTATION_EMB){
/* printf("it is an embedding val = %d, file = %s\n", val, m->filename[mcd_col]); */ /* printf("it is an embedding val = %d, file = %s\n", val, m->filename[mcd_col]); */
word_emb_print(stdout, m->word_emb_array[mcd_col], val); word_emb_print(stderr, m->word_emb_array[mcd_col], val);
printf("\n"); printf("\n");
} }
if(m->representation[mcd_col] == MCD_REPRESENTATION_VOCAB){ if(m->representation[mcd_col] == MCD_REPRESENTATION_VOCAB){
/* printf("it is a vocab\n"); */ /* printf("it is a vocab\n"); */
one_hot_print(stdout, val, m->dico_array[mcd_col]->nbelem); one_hot_print(stderr, val, m->dico_array[mcd_col]->nbelem);
printf("\n"); printf("\n");
} }
} }
...@@ -107,6 +110,8 @@ int main(int argc, char *argv[]) ...@@ -107,6 +110,8 @@ int main(int argc, char *argv[])
mcd_link_to_dico(ctx->mcd_struct, ctx->vocabs, 1); mcd_link_to_dico(ctx->mcd_struct, ctx->vocabs, 1);
printf("Coucou\n");
cff2fann(ctx); cff2fann(ctx);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment