Artificial intelligence 如何修复带更多节点的锥形评估

Artificial intelligence 如何修复带更多节点的锥形评估,artificial-intelligence,eval,chess,Artificial Intelligence,Eval,Chess,我刚刚实现了锥形评估,但我不确定我是否真的完成了,因为这会破坏移动顺序 我使用这个fen进行测试:r3k2r/p1ppqpb1/bn2pn1/3PN3/1p2P3/2N2Q1p/pppbbpp/r3k2r w KQkq-01 以下是锥形评估的信息: info depth 1 score cp 18.000000 nodes 65 time 116 pv e2a6 info depth 2 score cp 18.000000 nodes 165 time 402 pv e2a6 b4c3 inf

我刚刚实现了锥形评估,但我不确定我是否真的完成了,因为这会破坏移动顺序

我使用这个fen进行测试:
r3k2r/p1ppqpb1/bn2pn1/3PN3/1p2P3/2N2Q1p/pppbbpp/r3k2r w KQkq-01
以下是锥形评估的信息:

info depth 1 score cp 18.000000 nodes 65 time 116 pv e2a6
info depth 2 score cp 18.000000 nodes 165 time 402 pv e2a6 b4c3
info depth 3 score cp 18.000000 nodes 457 time 568 pv e2a6 b4c3 d2c3
info depth 4 score cp 18.000000 nodes 3833 time 1108 pv e2a6 b4c3 d2c3 h3g2
info depth 5 score cp 17.000000 nodes 12212 time 1875 pv e2a6 e6d5 c3d5
info depth 6 score cp 17.000000 nodes 77350 time 4348 pv e2a6 e6d5 c3d5
bestmove e2a6 ponder e6d5
info depth 1 score cp 19.000000 nodes 75 time 66 pv e2a6
info depth 2 score cp 19.000000 nodes 175 time 182 pv e2a6 b4c3
info depth 3 score cp 19.000000 nodes 398 time 371 pv e2a6 b4c3 d2c3
info depth 4 score cp 19.000000 nodes 3650 time 947 pv e2a6 b4c3 d2c3 h3g2
info depth 5 score cp 18.000000 nodes 10995 time 1849 pv e2a6 e6d5 c3d5
info depth 6 score cp 18.000000 nodes 75881 time 4334 pv e2a6 e6d5 c3d5
bestmove e2a6 ponder e6d5
没有锥形评估:

info depth 1 score cp 18.000000 nodes 65 time 116 pv e2a6
info depth 2 score cp 18.000000 nodes 165 time 402 pv e2a6 b4c3
info depth 3 score cp 18.000000 nodes 457 time 568 pv e2a6 b4c3 d2c3
info depth 4 score cp 18.000000 nodes 3833 time 1108 pv e2a6 b4c3 d2c3 h3g2
info depth 5 score cp 17.000000 nodes 12212 time 1875 pv e2a6 e6d5 c3d5
info depth 6 score cp 17.000000 nodes 77350 time 4348 pv e2a6 e6d5 c3d5
bestmove e2a6 ponder e6d5
info depth 1 score cp 19.000000 nodes 75 time 66 pv e2a6
info depth 2 score cp 19.000000 nodes 175 time 182 pv e2a6 b4c3
info depth 3 score cp 19.000000 nodes 398 time 371 pv e2a6 b4c3 d2c3
info depth 4 score cp 19.000000 nodes 3650 time 947 pv e2a6 b4c3 d2c3 h3g2
info depth 5 score cp 18.000000 nodes 10995 time 1849 pv e2a6 e6d5 c3d5
info depth 6 score cp 18.000000 nodes 75881 time 4334 pv e2a6 e6d5 c3d5
bestmove e2a6 ponder e6d5
您可以看到,如果没有锥形eval,它的节点实际上比其他节点少,我只是想知道这是必要的,还是我只是实现了错误的节点

我的相位函数:

int totalPhase = pawnPhase * 16 + knightPhase * 4 + bishopPhase * 4 + rookPhase * 4 + queenPhase * 2;
int phase = totalPhase;

for each piece in node {
  if piece is pawn, phase -= pawnPhase
  else if piece is knight, phase -= knightPhase
  ... 
}

return (phase * 256 + (totalPhase / 2)) / totalPhase;
for (each piece in node) {
  ...score material weights and positional scores, etc.
}
evaluation = ((mgEvaluation * (256 - phase)) + (egEvaluation * phase)) / 256;
然后我在eval函数中添加了插值:

int totalPhase = pawnPhase * 16 + knightPhase * 4 + bishopPhase * 4 + rookPhase * 4 + queenPhase * 2;
int phase = totalPhase;

for each piece in node {
  if piece is pawn, phase -= pawnPhase
  else if piece is knight, phase -= knightPhase
  ... 
}

return (phase * 256 + (totalPhase / 2)) / totalPhase;
for (each piece in node) {
  ...score material weights and positional scores, etc.
}
evaluation = ((mgEvaluation * (256 - phase)) + (egEvaluation * phase)) / 256;
我在这个网站上得到了公式:


如果这确实是必要的,有人能给我一些建议来优化这一点吗?

锥形评估非常有用,需要使用,因为游戏早期/中期的战术与游戏结束时的战术大不相同。您没有提到如何对移动进行排序,但由于锥形评估在棋子方格表(PST)中为游戏中间位置提供了不同的数字,因此移动顺序自然会与以前略有不同。你得到的结果非常接近,似乎是可信的

使用锥形eval测试开始位置,并查看其结果是否与PST打开时的正常eval相同。对终局位置也做同样的操作,对终局位置只做PST,这也会给出相同的结果