MarkZH / Genetic_Chess

An amateur attempt at breeding a chess-playing AI.
MIT License
10 stars 2 forks source link

Add noise to evaluations #131

Closed MarkZH closed 9 months ago

MarkZH commented 1 year ago

If a random noise is added to scores, then maybe important genes will have to attain their "correct" values more quickly to overcome the noise (boost the signal-to-noise ratio).

This shouldn't be a gene since it will evolve to a near zero score. Maybe it should be an environmental factor that slowly decreases to allow for fine-grained optimizing.

Maybe this should be used early in games to diversify the openings used.

MarkZH commented 9 months ago
double Noise_Gene::score_board(const Board&, const Piece_Color, size_t) const noexcept
{
    const auto norm = priority(Game_Stage::OPENING) + priority(Game_Stage::ENDGAME);
    return Random::random_number<double>(-1, 1)/norm;
}

The division should prevent mutations from making the priority zero. If the priorities get too small, then the division is likely to blow up, making the player make crazy move and lose.

MarkZH commented 9 months ago

The Noise Gene doesn't even have to be a gene. Just an extra call to Random::gaussian() inside Genome::evaluate().

MarkZH commented 9 months ago

The enable/disable/probability (#140) Gene modifications should handle this better.