Commit 0d663dea authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Do not have a schedule for the learning rate

parent 15467747
......@@ -21,7 +21,6 @@ static size_t n_hidden_layers;
static size_t *hidden_sizes;
static double learning_rate;
static double exploration;
static double current_exploration = 1;
static size_t i_iteration = 0;
static struct yarrow256_ctx generator;
......@@ -60,7 +59,7 @@ main (int argc, char *argv[])
free (weights);
fprintf (stderr,
_
("Current exploration\tMean update\tValidation score\tMaximum weight\n"));
("Mean update\tValidation score\tMaximum weight\n"));
while (1)
{
self_learn (perceptron);
......@@ -77,7 +76,7 @@ parse_options (int argc, char *argv[])
uint8_t *seed;
char *end;
exploration = 0.05;
learning_rate = 1e-6;
learning_rate = 1e-5;
yarrow256_init (&generator, 0, NULL);
yarrow256_seed (&generator, strlen (default_seed), (void *) default_seed);
while (1)
......@@ -347,14 +346,11 @@ self_learn (TarotPerceptron * perceptron)
size_t n_scores;
double metric;
static int until_print_game = 100;
double exploration_reduction_remaining = current_exploration - exploration;
TarotPlayer forced_taker;
TarotCard forced_call;
size_t n_owners;
TarotPlayer owners[78];
double confidence;
exploration_reduction_remaining *= 0.999;
current_exploration = exploration + exploration_reduction_remaining;
yarrow256_random (&generator, sizeof (option), &option);
yarrow256_random (&generator, sizeof (sub_seed), sub_seed);
if (option % 4 == 0)
......@@ -440,7 +436,7 @@ self_learn (TarotPerceptron * perceptron)
behavior_data);
memcpy (&behavior, behavior_data, sizeof (behavior));
behavior_dbl = behavior;
if (behavior_dbl / max_dbl < current_exploration)
if (behavior_dbl / max_dbl < exploration)
{
next = random_move (game);
}
......@@ -491,7 +487,7 @@ self_learn (TarotPerceptron * perceptron)
}
printf ("\n");
setlocale (LC_NUMERIC, "");
fprintf (stderr, "%g\t%g\t%g\t%g\n", current_exploration, update,
fprintf (stderr, "%g\t%g\t%g\n", update,
metric, max_weight);
free (weights);
}
......
Markdown is supported
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