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

Start with a higher exploration level

parent 1085d15b
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: tarot 0.4.2.83-ebdc-dirty\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
"POT-Creation-Date: 2019-11-27 08:13+0100\n"
"PO-Revision-Date: 2019-11-26 20:11+0100\n"
"POT-Creation-Date: 2019-11-28 22:16+0100\n"
"PO-Revision-Date: 2019-11-28 22:17+0100\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French\n"
"Language: fr\n"
......@@ -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:82
#: src/tarot-app/tarot_perceptron_bootstrap.c:85
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:119
#: src/tarot-app/tarot_perceptron_bootstrap.c:122
#, 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:81
#: src/tarot-app/tarot_perceptron_bootstrap.c:84
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:85
#: src/tarot-app/tarot_perceptron_bootstrap.c:88
msgid "seed"
msgstr "graine"
......@@ -1573,20 +1573,22 @@ msgstr "Poignée"
msgid "Discarding"
msgstr "Écart"
#: src/tarot-app/tarot_perceptron_bootstrap.c:58
#: src/tarot-app/tarot_perceptron_bootstrap.c:61
#, c-format
msgid "Mean update\tValidation score\tMaximum weight\n"
msgstr "Mise à jour moyenne\\tScore de validation\\tPoids maximum\n"
msgid "Current exploration\tMean update\tValidation score\tMaximum weight\n"
msgstr ""
"Exploration actuelle\\tMise à jour moyenne\\tScore de validation\\tPoids "
"maximum\n"
#: src/tarot-app/tarot_perceptron_bootstrap.c:83
#: src/tarot-app/tarot_perceptron_bootstrap.c:86
msgid "learning-rate"
msgstr "taux-d-apprentissage"
#: src/tarot-app/tarot_perceptron_bootstrap.c:84
#: src/tarot-app/tarot_perceptron_bootstrap.c:87
msgid "exploration"
msgstr "exploration"
#: src/tarot-app/tarot_perceptron_bootstrap.c:106
#: src/tarot-app/tarot_perceptron_bootstrap.c:109
#, c-format
msgid ""
"Usage: tarot-perceptron-bootstrap [OPTIONS]... [HIDDEN_SIZE]...\n"
......@@ -1607,14 +1609,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:131
#: src/tarot-app/tarot_perceptron_bootstrap.c:134
#, 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:143
#: src/tarot-app/tarot_perceptron_bootstrap.c:146
#, c-format
msgid ""
"Error: the exploration probability should be a probability (between 0 and "
......@@ -1623,12 +1625,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:154
#: src/tarot-app/tarot_perceptron_bootstrap.c:157
#, 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:183
#: src/tarot-app/tarot_perceptron_bootstrap.c:186
#, c-format
msgid ""
"Error: the %d-th dimension should be a strictly positive integer, not '%s'.\n"
......
......@@ -20,6 +20,7 @@ static size_t n_hidden_layers;
static size_t *hidden_sizes;
static double learning_rate;
static double exploration;
static double current_exploration = 1;
static struct yarrow256_ctx generator;
static void parse_options (int argc, char *argv[]);
......@@ -55,7 +56,9 @@ main (int argc, char *argv[])
}
tarot_perceptron_load (perceptron, 0, n_weights, weights);
free (weights);
fprintf (stderr, _("Mean update\tValidation score\tMaximum weight\n"));
fprintf (stderr,
_
("Current exploration\tMean update\tValidation score\tMaximum weight\n"));
while (1)
{
self_learn (perceptron);
......@@ -313,6 +316,9 @@ self_learn (TarotPerceptron * perceptron)
static int until_print_game = 100;
double *data = NULL, max_weight = 0;
size_t n = 0, w;
double exploration_reduction_remaining = current_exploration - exploration;
exploration_reduction_remaining *= 0.99999;
current_exploration = exploration + exploration_reduction_remaining;
yarrow256_random (&generator, sizeof (option), &option);
yarrow256_random (&generator, sizeof (sub_seed), sub_seed);
if (option % 4 == 0)
......@@ -378,7 +384,7 @@ self_learn (TarotPerceptron * perceptron)
behavior_data);
memcpy (&behavior, behavior_data, sizeof (behavior));
behavior_dbl = behavior;
if (behavior_dbl / max_dbl < exploration)
if (behavior_dbl / max_dbl < current_exploration)
{
next = random_move (game);
}
......@@ -418,7 +424,8 @@ self_learn (TarotPerceptron * perceptron)
}
}
printf ("\n");
fprintf (stderr, "%g\t%g\t%g\n", update, metric, max_weight);
fprintf (stderr, "%g\t%g\t%g\t%g\n", current_exploration, update, metric,
max_weight);
free (data);
if (--until_print_game == 0)
{
......
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