Commit 7b522545 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Start with larger weights

The initial weights are set up so as to predict something between 0
and 1.  The score is likely to be between -500 and 500.
parent 1af99375
......@@ -48,7 +48,7 @@ msgstr "Affiche l'information de version et quitte"
#: src/tarot-app/tarot_deal.c:70 src/tarot-app/tarot_mcts.c:88
#: src/tarot-app/tarot_stacking.c:80 src/tarot-app/tarot_features.c:62
#: src/tarot-app/tarot_cnn_features.c:58
#: src/tarot-app/tarot_perceptron_bootstrap.c:61
#: src/tarot-app/tarot_perceptron_bootstrap.c:71
msgid "version"
msgstr "version"
......@@ -56,7 +56,7 @@ msgstr "version"
#: src/tarot-app/tarot_deal.c:112 src/tarot-app/tarot_mcts.c:136
#: src/tarot-app/tarot_stacking.c:112 src/tarot-app/tarot_features.c:93
#: src/tarot-app/tarot_cnn_features.c:89
#: src/tarot-app/tarot_perceptron_bootstrap.c:98
#: src/tarot-app/tarot_perceptron_bootstrap.c:108
#, c-format
msgid ""
"%s (libtarot %s)\n"
......@@ -1205,7 +1205,7 @@ msgstr ""
#: src/tarot-app/tarot_deal.c:69 src/tarot-app/tarot_mcts.c:87
#: src/tarot-app/tarot_stacking.c:79 src/tarot-app/tarot_features.c:61
#: src/tarot-app/tarot_cnn_features.c:57
#: src/tarot-app/tarot_perceptron_bootstrap.c:60
#: src/tarot-app/tarot_perceptron_bootstrap.c:70
msgid "help"
msgstr "aide"
......@@ -1222,7 +1222,7 @@ msgid "no-call-allowed"
msgstr "appel-interdit"
#: src/tarot-app/tarot_deal.c:74 src/tarot-app/tarot_mcts.c:90
#: src/tarot-app/tarot_perceptron_bootstrap.c:64
#: src/tarot-app/tarot_perceptron_bootstrap.c:74
msgid "seed"
msgstr "graine"
......@@ -1573,20 +1573,20 @@ msgstr "Poignée"
msgid "Discarding"
msgstr "Écart"
#: src/tarot-app/tarot_perceptron_bootstrap.c:37
#: src/tarot-app/tarot_perceptron_bootstrap.c:47
#, c-format
msgid "Mean update\tValidation score\tMaximum weight\n"
msgstr "Mise à jour moyenne\\tScore de validation\\tPoids maximum\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:62
#: src/tarot-app/tarot_perceptron_bootstrap.c:72
msgid "learning-rate"
msgstr "taux-d-apprentissage"
#: src/tarot-app/tarot_perceptron_bootstrap.c:63
#: src/tarot-app/tarot_perceptron_bootstrap.c:73
msgid "exploration"
msgstr "exploration"
#: src/tarot-app/tarot_perceptron_bootstrap.c:85
#: src/tarot-app/tarot_perceptron_bootstrap.c:95
#, c-format
msgid ""
"Usage: tarot-perceptron-bootstrap [OPTIONS]... [HIDDEN_SIZE]...\n"
......@@ -1607,14 +1607,14 @@ msgstr ""
"- -s GRAINE, --seed=GRAINE : définit la graine aléatoire. GRAINE ne\n"
" peut pas être une chaîne vide.\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:110
#: src/tarot-app/tarot_perceptron_bootstrap.c:120
#, c-format
msgid "Error: the learning rate should be a positive number, not '%s'.\n"
msgstr ""
"Erreur : le taux d'apprentissage doit être un nombre positif, et pas "
"« %s ».\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:122
#: src/tarot-app/tarot_perceptron_bootstrap.c:132
#, c-format
msgid ""
"Error: the exploration probability should be a probability (between 0 and "
......@@ -1623,12 +1623,12 @@ msgstr ""
"Erreur : la probabilité d'exploration doit être une probabilité (entre\n"
"0 et 1), et pas « %s ».\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:133
#: src/tarot-app/tarot_perceptron_bootstrap.c:143
#, c-format
msgid "Error: the seed must not be empty.\n"
msgstr "Erreur : la graine ne doit pas être vide.\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:162
#: src/tarot-app/tarot_perceptron_bootstrap.c:172
#, c-format
msgid ""
"Error: the %d-th dimension should be a strictly positive integer, not '%s'.\n"
......
......@@ -30,10 +30,20 @@ int
main (int argc, char *argv[])
{
TarotPerceptron *perceptron;
size_t n_weights, i;
double *weights;
tarot_program_setup ();
parse_options (argc, argv);
perceptron =
tarot_perceptron_alloc (n_hidden_layers, hidden_sizes, learning_rate);
/* Initial weights are too low */
tarot_perceptron_save_alloc (perceptron, &n_weights, &weights);
for (i = 0; i < n_weights; i++)
{
weights[i] *= 1000;
}
tarot_perceptron_load (perceptron, 0, n_weights, weights);
free (weights);
fprintf (stderr, _("Mean update\tValidation score\tMaximum weight\n"));
while (1)
{
......
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