Ippolit and contempt.
Ippolit and contempt.
This is a feature absent on the "Ippolits".
There exists a couple of variables in Evaluation.c: wDrawWeight and bDrawWeight, but they are (I think) unused.
In Fire, the author has added a simple multiplier:
Value -= (PAWN_INFO->wDrawWeight * MIN (Value, 100)) / 64 * DrawWeight / 100;
This, however, seems to me a very small thing....
No one has ever thought to implement a function of "contempt" in the Ippolits? Are there any plans or proposals?
Thx in advance,
Roberto.
There exists a couple of variables in Evaluation.c: wDrawWeight and bDrawWeight, but they are (I think) unused.
In Fire, the author has added a simple multiplier:
Value -= (PAWN_INFO->wDrawWeight * MIN (Value, 100)) / 64 * DrawWeight / 100;
This, however, seems to me a very small thing....
No one has ever thought to implement a function of "contempt" in the Ippolits? Are there any plans or proposals?
Thx in advance,
Roberto.
Re: Ippolit and contempt.
This is the result of Deep Saros in the first round of a tournament (Don Daley Tribute, by Graham Banks):
7. DEEPSAROS 4.1.4 64-BIT 8CPU 15 7.5 = 0 1 0 1 0 * = = = = = = 1 = =
He fought well against the best (tied with Houdini, lost against Stockfish and Critter, won against Rybka and Komodo), but against the weaker engines have picked up only a series of draws... How many points wasted!
Here, however, the results of Rybka in the same tournament.
3. RYBKA 4.1 64-BIT 8CPU 15 10.0 = = * = 1 = 0 1 = = = 1 1 = 1 1
His results against stronger engines, are worse than those of Saros, but he has won almost all the games against the weaker engines.
The result is that Rybka is now in 3rd place, while Saros is 7th place.
A proper function of contempt, makes the difference!
7. DEEPSAROS 4.1.4 64-BIT 8CPU 15 7.5 = 0 1 0 1 0 * = = = = = = 1 = =
He fought well against the best (tied with Houdini, lost against Stockfish and Critter, won against Rybka and Komodo), but against the weaker engines have picked up only a series of draws... How many points wasted!
Here, however, the results of Rybka in the same tournament.
3. RYBKA 4.1 64-BIT 8CPU 15 10.0 = = * = 1 = 0 1 = = = 1 1 = 1 1
His results against stronger engines, are worse than those of Saros, but he has won almost all the games against the weaker engines.
The result is that Rybka is now in 3rd place, while Saros is 7th place.
A proper function of contempt, makes the difference!
Re: Ippolit and contempt.
My engine also has serious problems with too many draws.
I'm researching at the end of evaluation, when we send the Score to the search, very simply like this:
Also would be interesting to work three repetitions, not to fall too much.
Greetings, Jose.
I'm researching at the end of evaluation, when we send the Score to the search, very simply like this:
This makes something, but you can add parameters.if (Position->white_to_move && Value == 0) // 7 may be an option UCI
{
Value += 7;// if Score PV is +0.04, now is +0.11
}
if (!Position->white_to_move && Value == 0)
{
Value -= 7; // if Score PV is -0.04, now is -0.11
}
or, beginning to complicate:
if (Position->white_to_move && Value == 0)
{
Value += 7;// if Score PV is +0.04, now is +0.11
}
if (Position->white_to_move && Value >= 12)
{
Value += 7; // if Score PV is +0.12, now is +0.19
}
ect, ect.
Also would be interesting to work three repetitions, not to fall too much.
Greetings, Jose.
Re: Ippolit and contempt.
Thx Josè,
is an interesting idea. Someone also suggested to run an 'asymmetric contempt' on the King_safety. This would make the engine very aggressive ... Although the risk is high.
is an interesting idea. Someone also suggested to run an 'asymmetric contempt' on the King_safety. This would make the engine very aggressive ... Although the risk is high.
Re: Ippolit and contempt.
I never really looked at Ippolit's code (because it's illegible). But contempt=draw score is not a feature of the eval. It's normally done by the search. It is the search that detects draws by chess rules (3-rep, 50 move, stalemate, insufficient material). So it's in the search that you score them -Contempt for the root color (ie. the engine) and +Contempt for the non root color (ie. the opponent).carotino wrote:This is a feature absent on the "Ippolits".
There exists a couple of variables in Evaluation.c: wDrawWeight and bDrawWeight, but they are (I think) unused.
In Fire, the author has added a simple multiplier:
Value -= (PAWN_INFO->wDrawWeight * MIN (Value, 100)) / 64 * DrawWeight / 100;
This, however, seems to me a very small thing....
No one has ever thought to implement a function of "contempt" in the Ippolits? Are there any plans or proposals?
Thx in advance,
Roberto.
I made some experiments with contempt a while ago. What comes out of it is that it does not hurt to have a default contempt (provided it's not too big). It mostly prevents repetition draws when the otherwise eval is close enough to zero. That way engines play until death rather than accept a draw without fighting. I much prefer it that way (I hate unsought repetition draws)
viewtopic.php?f=5&t=2321
An extreme variation would be to score draws as mates. Which is equivalent to Contempt = +infinity. There is probably not much elo loss in doing it, but you would have the most stubborn engine, ever, like that.
"Talk is cheap. Show me the code." -- Linus Torvalds.
Re: Ippolit and contempt.
I fully agree: the code of Ippolit is a damned tangle!
I like your idea of 'extreme contempt' (same value as the mate)...
I like your idea of 'extreme contempt' (same value as the mate)...
-
- Posts: 1242
- Joined: Thu Jun 10, 2010 2:13 am
- Real Name: Bob Hyatt (Robert M. Hyatt)
- Location: University of Alabama at Birmingham
- Contact:
Re: Ippolit and contempt.
carotino wrote:I fully agree: the code of Ippolit is a damned tangle!
I like your idea of 'extreme contempt' (same value as the mate)...
You should test it. You will NOT get what you expect to get. You will get almost 100% draws, except for the losses. Mostly due to repetition when you COULD force mate, but since repeat = mate, that happens easier.
Re: Ippolit and contempt.
Oh, this is also true... Well, never mind.
I will try the idea of José, by the method of Houdini: high contempt in the opening, and lighter in middle-game, but not now.
Now I wish you all a happy Christmas and a peaceful New Year.
Ad majora!
I will try the idea of José, by the method of Houdini: high contempt in the opening, and lighter in middle-game, but not now.
Now I wish you all a happy Christmas and a peaceful New Year.
Ad majora!
Re: Ippolit and contempt.
These come from the pawn structure, and are folded into the eval:There exists a couple of variables in Evaluation.c: wDrawWeight and bDrawWeight, but they are (I think) unused.
Code: Select all
if (Value > 0) Value -= (PAWN_INFO->wDrawWeight * MIN (Value, 100)) / 64;
else Value += (PAWN_INFO->bDrawWeight * MIN (-Value, 100)) / 64;
Code: Select all
static uint8 OpposingPawnsMult[9] = { 6, 5, 4, 3, 2, 1, 0, 0, 0 };
static uint8 PawnCountMult[9] = { 6, 5, 4, 3, 2, 1, 0, 0, 0 };
Code: Select all
RESULT->wPfile_count = POPCNT (T); // number of file with a white pawn
RESULT->bPfile_count = POPCNT (U); // number of files with a black pawn
RESULT->OpenFileCount = 8 - POPCNT (T | U); // this *does* seems to be unused though
RESULT->wDrawWeight = OpposingPawnsMult[POPCNT (T & ~U)] * PawnCountMult[RESULT->wPfile_count];
RESULT->bDrawWeight = OpposingPawnsMult[POPCNT (U & ~T)] * PawnCountMult[RESULT->bPfile_count];
Re: Ippolit and contempt.
Carotino i use a similar approach inside BlackMamba but with an array like thisvelmarin wrote:My engine also has serious problems with too many draws.
I'm researching at the end of evaluation, when we send the Score to the search, very simply like this:This makes something, but you can add parameters.if (Position->white_to_move && Value == 0) // 7 may be an option UCI
{
Value += 7;// if Score PV is +0.04, now is +0.11
}
if (!Position->white_to_move && Value == 0)
{
Value -= 7; // if Score PV is -0.04, now is -0.11
}
or, beginning to complicate:
if (Position->white_to_move && Value == 0)
{
Value += 7;// if Score PV is +0.04, now is +0.11
}
if (Position->white_to_move && Value >= 12)
{
Value += 7; // if Score PV is +0.12, now is +0.19
}
ect, ect.
Also would be interesting to work three repetitions, not to fall too much.
Greetings, Jose.
Code: Select all
static const int ContemptValue[32] =
{20,20,19,19,18,18,17,17,17,16,16,15,15,14,14,13,13,13,12,12,11,11,10,10,10,9,9,8,8,7,7,6}
Code: Select all
if (Position->white_to_move && Value == 0)
{
Value += ContemptValue[phase];
}
if (!Position->white_to_move && Value == 0)
{
Value -= ContemptValue[phase];
}
/Matteo