Commit 49654891 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Use a C locale to print the model

This lets me use commas as separators.
parent 43109655
......@@ -465,11 +465,12 @@ self_learn (TarotPerceptron * perceptron)
double update = tarot_perceptron_learn_game (perceptron, game);
char *xml = tarot_game_save_to_xml_alloc (game);
tarot_perceptron_save_alloc (perceptron, &n, &weights);
setlocale (LC_NUMERIC, "C");
for (w = 0; w < n; w++)
{
if (w != 0)
{
printf ("\t");
printf (",");
}
printf ("%f", weights[w]);
if (weights[w] > max_weight || -weights[w] > max_weight)
......@@ -485,6 +486,7 @@ self_learn (TarotPerceptron * perceptron)
}
}
printf ("\n");
setlocale (LC_NUMERIC, "");
fprintf (stderr, "%g\t%g\t%g\t%g\n", current_exploration, update,
metric, max_weight);
free (weights);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment