circle
This commit is contained in:
1 parent
e00bb7d59b
commit
5588a1d6ac
6 files changed
+52
-32
No files matched your search
@@ -126,8 +126,7 @@ Keyboard shortcuts are shown with **[key]**.
|
||||
* **[a]**: Deeper analysis: Re-evaluate the position using more visits, usually resulting in a more accurate evaluation.
|
||||
* **[s]**: Equalize visits: Re-evaluate all currently shown next moves with the same visits as the current top move. Useful to increase confidence in the suggestions with high uncertainty.
|
||||
* **[d]**: Analyze all moves: Evaluate all possible next moves. This can take a bit of time even though 'fast_visits' is used, but can be useful to see how many reasonable next moves are available.
|
||||
* **[f]**: Re-analyze game: ...
|
||||
* **[spacebar]**: Turn continuous analysis on/off.
|
||||
* **[spacebar]**: Turn continuous analysis on/off. This will continuously improve analysis of the current position, similar to Lizzie's 'pondering', but only when there are no other queries going on.
|
||||
* **[enter]** AI move. Makes the AI move for the current player regardless of current player selection.
|
||||
|
||||
### Rank Estimation
|
||||
@@ -150,7 +149,7 @@ In addition to shortcuts mentioned above and those shown in the main menu:
|
||||
* **[scroll up]**: Undo move. Only works when hovering the cursor over the board.
|
||||
* **[scroll down]**: Redo move. Only works when hovering the cursor over the board.
|
||||
* **[click on a move]**: See detailed statistics for a previous move, along with expected variation that was best instead of this move.
|
||||
* **[double-click on a move]**: Navigate directly to that point in the game.
|
||||
* **[double-click on a move]**: Navigate directly to just before that point in the game.
|
||||
* **[Ctrl-V]**: Load SGF from clipboard and do a 'fast' analysis of the game (with a high priority normal analysis for the last move).
|
||||
* **[Ctrl-C]**: Save SGF to clipboard.
|
||||
|
||||
|
||||
+1
-1
@@ -230,7 +230,7 @@ def generate_ai_move(game: Game, ai_mode: str, ai_settings: Dict) -> Tuple[Move,
|
||||
board_squares = size[0] * size[1]
|
||||
if ai_mode == AI_RANK: # calibrated, override from 0.8 at start to ~0.4 at full board
|
||||
override = 0.8 * (1 - 0.5 * (board_squares - len(legal_policy_moves)) / board_squares)
|
||||
overridetwo = 0.85
|
||||
overridetwo = 0.85 + max(0, 0.02 * (ai_settings["kyu_rank"] - 8))
|
||||
else:
|
||||
override = ai_settings["pick_override"]
|
||||
overridetwo = 1.0
|
||||
|
||||
+36
-27
@@ -127,50 +127,59 @@ AI_LOCAL_ELO_GRID = [
|
||||
[0.0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0],
|
||||
[0, 5, 10, 15, 25, 50],
|
||||
[
|
||||
[200.0, 806.21655824, 1293.32037587, 1392.29465619, 1423.34086023, 1475.35678018, 1631.70997963, 1700.0],
|
||||
[271.88274382, 1177.38904493, 1357.48028947, 1427.89588231, 1471.76588449, 1531.66834985, 1700.0, 1700.0],
|
||||
[725.2189244, 1233.32342855, 1392.46449871, 1443.99394784, 1415.66026743, 1490.09450071, 1700.0, 1700.0],
|
||||
[986.18843485, 1315.19341299, 1423.36540576, 1438.78299774, 1499.2278826, 1570.46885902, 1700.0, 1700.0],
|
||||
[1334.16982939, 1401.31972528, 1430.66495587, 1450.4662417, 1510.77588056, 1575.68586904, 1700.0, 1700.0],
|
||||
[1388.06911342, 1451.04383633, 1391.07099726, 1500.84987644, 1520.43287013, 1700.0, 1700.0, 1700.0],
|
||||
[450.0, 704.0, 1190.0, 1282.0, 1520.0, 1464.0, 1617.0, 1700.0],
|
||||
[153.0, 1079.0, 1144.0, 1335.0, 1440.0, 1525.0, 1700.0, 1700.0],
|
||||
[606.0, 1185.0, 1268.0, 1484.0, 1404.0, 1544.0, 1700.0, 1700.0],
|
||||
[911.0, 1230.0, 1312.0, 1352.0, 1432.0, 1564.0, 1700.0, 1700.0],
|
||||
[1212.0, 1326.0, 1393.0, 1441.0, 1446.0, 1601.0, 1700.0, 1700.0],
|
||||
[1321.0, 1395.0, 1399.0, 1473.0, 1582.0, 1700.0, 1700.0, 1700.0],
|
||||
],
|
||||
]
|
||||
|
||||
AI_TENUKI_ELO_GRID = [
|
||||
[0.0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0],
|
||||
[0, 5, 10, 15, 25, 50],
|
||||
[
|
||||
[100, 381.67199019, 614.9022033, 807.74726571, 972.75719068, 1081.59259337, 1280.81772836, 1700.0],
|
||||
[302.05524257, 447.16707419, 634.67443071, 847.73134951, 980.06971493, 1100.47221165, 1424.97514319, 1700.0],
|
||||
[395.99120046, 565.59284207, 707.35509522, 883.39067276, 997.20744208, 1125.50994832, 1392.10412559, 1700.0],
|
||||
[468.10121071, 660.65479606, 774.42716944, 862.84933335, 1010.69484968, 1156.68204921, 1436.80030417, 1700.0],
|
||||
[652.8285294, 753.57925069, 797.59399585, 898.99936585, 1042.96870256, 1222.48814041, 1470.92773923, 1700.0],
|
||||
[901.40390178, 910.28781658, 958.0281189, 1126.63475026, 1203.75546167, 1352.13779312, 1493.13435049, 1700.0],
|
||||
[491.0, 394.0, 527.0, 676.0, 732.0, 959.0, 1415.0, 1700.0],
|
||||
[21.0, 456.0, 620.0, 719.0, 812.0, 1027.0, 1308.0, 1700.0],
|
||||
[306.0, 480.0, 689.0, 705.0, 925.0, 1154.0, 1397.0, 1700.0],
|
||||
[286.0, 534.0, 636.0, 796.0, 968.0, 1077.0, 1443.0, 1700.0],
|
||||
[534.0, 645.0, 665.0, 846.0, 999.0, 1134.0, 1422.0, 1700.0],
|
||||
[746.0, 719.0, 806.0, 975.0, 1048.0, 1370.0, 1505.0, 1700.0],
|
||||
],
|
||||
]
|
||||
|
||||
AI_TERRITORY_ELO_GRID = [
|
||||
[0.0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0],
|
||||
[0, 5, 10, 15, 25, 50],
|
||||
[
|
||||
[0, 491.99354617, 652.54536499, 827.56438866, 997.07978087, 1207.47161931, 1461.93571907, 1700.0],
|
||||
[119.03096728, 554.30545095, 747.74695281, 852.1114908, 1049.58656646, 1250.72046036, 1475.72706895, 1700.0],
|
||||
[348.45765825, 589.16893663, 775.81559273, 909.21125406, 1073.92675377, 1300.11842657, 1485.95667768, 1700.0],
|
||||
[538.88999479, 676.21745434, 821.27037414, 950.58649838, 1126.1274156, 1358.9290967, 1500.00471917, 1700.0],
|
||||
[597.90794583, 741.3513872, 884.73016339, 972.54025369, 1150.30545203, 1430.55449307, 1566.81074945, 1700.0],
|
||||
[826.03134794, 997.58427811, 1093.54942758, 1214.9588177, 1336.40285376, 1485.32581091, 1700.0, 1700.0],
|
||||
[512.0, 451.0, 640.0, 686.0, 929.0, 1112.0, 1533.0, 1700.0],
|
||||
[155.0, 419.0, 614.0, 761.0, 879.0, 1118.0, 1507.0, 1700.0],
|
||||
[338.0, 449.0, 716.0, 945.0, 949.0, 1282.0, 1520.0, 1700.0],
|
||||
[400.0, 495.0, 702.0, 875.0, 950.0, 1309.0, 1520.0, 1700.0],
|
||||
[570.0, 635.0, 707.0, 981.0, 922.0, 1346.0, 1519.0, 1700.0],
|
||||
[713.0, 772.0, 839.0, 1095.0, 1217.0, 1468.0, 1700.0, 1700.0],
|
||||
],
|
||||
]
|
||||
|
||||
AI_INFLUENCE_ELO_GRID = [
|
||||
[0.0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0],
|
||||
[0, 5, 10, 15, 25, 50],
|
||||
[
|
||||
[75.9591829, 483.922460, 703.633297, 898.804165, 1041.90611, 1180.64701, 1500.22844, 1510.60242,],
|
||||
[285.94611, 598.87800, 673.848093, 866.826392, 1032.48205, 1334.284716, 1510.55098, 1520.774582,],
|
||||
[478.37028, 643.868326, 837.7348868, 945.3233087, 1093.119452, 1350.0936572, 1515.4939758, 1530.1492031,],
|
||||
[570.841325, 689.7079695, 848.3192009, 1021.7089457, 1143.3090057, 1371.453538, 1520.4852553, 1540.64105,],
|
||||
[749.495401, 771.144054, 865.13815, 1019.895054, 1107.959449, 1383.373536, 1525.298316, 1549.8151732,],
|
||||
[882.96911, 902.885106, 1057.305618, 1178.3968159, 1369.4749768, 1518.303563, 1530.772607, 1550.508035,],
|
||||
[570.0, 293.0, 536.0, 774.0, 919.0, 1236.0, 1491.0, 1518.0],
|
||||
[238.0, 461.0, 628.0, 833.0, 859.0, 1211.0, 1459.0, 1592.0],
|
||||
[323.0, 513.0, 667.0, 837.0, 941.0, 1224.0, 1504.0, 1576.0],
|
||||
[407.0, 545.0, 659.0, 899.0, 988.0, 1215.0, 1483.0, 1602.0],
|
||||
[457.0, 713.0, 785.0, 856.0, 1142.0, 1309.0, 1508.0, 1506.0],
|
||||
[774.0, 903.0, 942.0, 1098.0, 1339.0, 1449.0, 1469.0, 1495.0],
|
||||
],
|
||||
]
|
||||
AI_PICK_ELO_GRID = [
|
||||
[0.0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0],
|
||||
[0, 5, 10, 15, 25, 50],
|
||||
[
|
||||
[106.0, 148.0, 94.0, 218.0, 606.0, 1063.0, 1426.0, 1458.0],
|
||||
[114.0, 69.0, 278.0, 385.0, 683.0, 1099.0, 1425.0, 1517.0],
|
||||
[144.0, 174.0, 186.0, 452.0, 730.0, 1153.0, 1430.0, 1447.0],
|
||||
[145.0, 105.0, 380.0, 548.0, 863.0, 1233.0, 1423.0, 1448.0],
|
||||
[202.0, 251.0, 460.0, 651.0, 919.0, 1321.0, 1554.0, 1482.0],
|
||||
[472.0, 538.0, 816.0, 971.0, 1169.0, 1422.0, 1522.0, 1491.0],
|
||||
],
|
||||
]
|
||||
@@ -431,6 +431,9 @@ class BadukPanWidget(Widget):
|
||||
col=[*self.eval_color(move_dict["pointsLost"])[:3], alpha],
|
||||
r=self.stone_size * scale,
|
||||
)
|
||||
if i==0:
|
||||
Color(*TOP_MOVE_BORDER_COLOR)
|
||||
Line(circle=(self.gridpos_x[move.coords[0]], self.gridpos_y[move.coords[1]],self.stone_size * scale),width=1.1)
|
||||
|
||||
# hover next move ghost stone
|
||||
if self.ghost_stone:
|
||||
|
||||
@@ -51,6 +51,7 @@ VISITS_FRAC_SMALL = 0.1
|
||||
|
||||
GHOST_ALPHA = 0.5
|
||||
TOP_MOVE_ALPHA = 0.4
|
||||
TOP_MOVE_BORDER_COLOR = [46 / 255, 65 / 255, 88 / 255,0.9]
|
||||
CHILD_SCALE = 0.95
|
||||
|
||||
# ponder light
|
||||
|
||||
+9
-1
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
import os
|
||||
from katrain.core.ai import generate_ai_move
|
||||
from katrain.core.ai import generate_ai_move, ai_rank_estimation
|
||||
from katrain.core.constants import AI_STRATEGIES_RECOMMENDED_ORDER, AI_STRATEGIES, OUTPUT_INFO
|
||||
from katrain.core.base_katrain import KaTrainBase
|
||||
from katrain.core.engine import KataGoEngine
|
||||
@@ -35,3 +35,11 @@ class TestAI:
|
||||
move, played_node = generate_ai_move(game, strategy, settings)
|
||||
katrain.log(f"Testing strategy on first move {strategy} -> {move}", OUTPUT_INFO)
|
||||
assert game.current_node.depth == 1
|
||||
|
||||
def test_ai_rank_estimation(self):
|
||||
katrain = KaTrainBase(force_package_config=True, debug_level=0)
|
||||
for strategy in AI_STRATEGIES:
|
||||
settings = katrain.config(f"ai/{strategy}")
|
||||
rank,flag = ai_rank_estimation(strategy,settings)
|
||||
assert 20 <= rank <= 9
|
||||
assert isinstance(flag,bool)
|
||||
Reference in new issue
Block a user