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

Use a duplicaté settings for the perceptron bootstrap

This kills exploration a little, but it lets us learn from 100% of the
games.  Otherwise, 4vs1 and 3vs1 games would be ignored most of the
time.
parent d2ef44f1
...@@ -346,6 +346,11 @@ self_learn (TarotPerceptron * perceptron) ...@@ -346,6 +346,11 @@ self_learn (TarotPerceptron * perceptron)
double metric; double metric;
static int until_print_game = 100; static int until_print_game = 100;
double exploration_reduction_remaining = current_exploration - exploration; 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.99999; exploration_reduction_remaining *= 0.99999;
current_exploration = exploration + exploration_reduction_remaining; current_exploration = exploration + exploration_reduction_remaining;
yarrow256_random (&generator, sizeof (option), &option); yarrow256_random (&generator, sizeof (option), &option);
...@@ -385,7 +390,27 @@ self_learn (TarotPerceptron * perceptron) ...@@ -385,7 +390,27 @@ self_learn (TarotPerceptron * perceptron)
tarot_game_free (game); tarot_game_free (game);
return; return;
} }
if (tarot_game_event_get_deal_all (deal_event, &n_owners, 0, 78, owners) !=
TAROT_EVENT_OK)
{
assert (0);
}
assert (n_owners == 78);
forced_taker =
tarot_features_strongest_player (n_players, with_call, n_owners, owners,
&confidence, &forced_call);
tarot_game_event_free (deal_event); tarot_game_event_free (deal_event);
if (tarot_game_duplicate_set_taker (game, forced_taker) != TAROT_GAME_OK)
{
assert (0);
}
if (with_call)
{
if (tarot_game_duplicate_set_call (game, forced_call) != TAROT_GAME_OK)
{
assert (0);
}
}
while (tarot_game_get_scores (game, &n_scores, 0, 0, NULL) != TAROT_GAME_OK) while (tarot_game_get_scores (game, &n_scores, 0, 0, NULL) != TAROT_GAME_OK)
{ {
TarotCard *dog; TarotCard *dog;
......
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