Hey guys,
I recently discovered a bug (ok an amateurs mistake) in my program. The evaluation function will sometimes return a value of greater than 100 (a pawn is worth 100).
Obviously it was playing some dumb moves. Loosing pieces for a perceived positional advantage.
The eval function uses PST, mobility, doubles/backward/isolated pawns, king safety etc, etc. I have positive values for good things like mobility and negative values for bad things like doubled pawns. I was hoping that the negative values would restrain the positive values from increasing too much.
How can i make sure that in ALL combinations of positions I never exceed 100.
Evaluation function
Moderators: hgm, Rebel, chrisw
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Evaluation function
You can, but you shouldn't. You can always do the uglylauriet wrote:Hey guys,
I recently discovered a bug (ok an amateurs mistake) in my program. The evaluation function will sometimes return a value of greater than 100 (a pawn is worth 100).
Obviously it was playing some dumb moves. Loosing pieces for a perceived positional advantage.
The eval function uses PST, mobility, doubles/backward/isolated pawns, king safety etc, etc. I have positive values for good things like mobility and negative values for bad things like doubled pawns. I was hoping that the negative values would restrain the positive values from increasing too much.
How can i make sure that in ALL combinations of positions I never exceed 100.
score = Max(Min(score, 100), -100);
But lots of scores SHOULD be > one pawn. King safety. Unstoppable passed pawns. Etc...
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: Evaluation function
Would be interesting to try in Stockfish. It would result in a stupidly materialistic eval.
I bet it would be a 100 elo regression, or worse.
I bet it would be a 100 elo regression, or worse.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
-
- Posts: 199
- Joined: Sun Nov 03, 2013 9:32 am
Re: Evaluation function
but for the hundred and one positions that should be less than one pawn...........
does everyone check all these positions so that the value < 100
does everyone check all these positions so that the value < 100
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: Evaluation function
nobody does that, it's nonsense. you need to adjust (tune) you eval weights.lauriet wrote:but for the hundred and one positions that should be less than one pawn...........
does everyone check all these positions so that the value < 100
easier said than done of course.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Evaluation function
[D]8/8/7k/P5p1/5pKp/8/8/8 w - - 0 1lauriet wrote:but for the hundred and one positions that should be less than one pawn...........
does everyone check all these positions so that the value < 100
The unstoppable passer should be worth much more than two pawns in this case.
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Evaluation function
There are plenty of advantages worth more than a Pawn. If you score positional advantages that are worth less than a Pawn above 100, you should simply lower their score, because then apparently you overestimated them.
There is no logic in the idea that 3 advantages each worth half a Pawn should not add up to 1.5 Pawn. In fact if there is anything non-additive there, it would be that advantages amplify each other, rather than saturate.
There is no logic in the idea that 3 advantages each worth half a Pawn should not add up to 1.5 Pawn. In fact if there is anything non-additive there, it would be that advantages amplify each other, rather than saturate.
-
- Posts: 759
- Joined: Fri Jan 04, 2013 4:55 pm
- Location: Nice
Re: Evaluation function
I think the danger is in a false "> 100 " positionnal advantage , returned by an evaluation function bad tuned .
We can have a positionnal avantage worth more than a pawn if it is a real avantage right? Unless our engine can't win a game positionaly, it'll search only for a material avantage no?
Here is the dificulty:
It need a good eval very well tuned , it's the game of chess programming , it's all the fun for me : playing with the eval (and the search) 😉
We can have a positionnal avantage worth more than a pawn if it is a real avantage right? Unless our engine can't win a game positionaly, it'll search only for a material avantage no?
Here is the dificulty:
It need a good eval very well tuned , it's the game of chess programming , it's all the fun for me : playing with the eval (and the search) 😉