Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Elilgo324 committed Jun 5, 2020
1 parent 62c8bd1 commit 4e500d3
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 9 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@

# run vs wolve
model = load_model('/home/avshalom/PycharmProjects/zeroHex/agent1_zero_dnn/model')
# /home/avshalom/PycharmProjects/benzene-vanilla-cmake
wolve = WolveProcess("/home/avshalom/PycharmProjects/benzene-vanilla-cmake/build/src/wolve/wolve")
res


# compare models
/Users/orifogler/PycharmProjects/zeroHex/agent1_zero_dnn/compare.py
model model

# training
/Users/orifogler/PycharmProjects/zeroHex/agent1_zero_dnn/learning.py

# zeroHex
Human players prefer training with human opponents over agents as the latter are distinctively different in level and style than humans.
Agents designed for human-agent play are capable of adjusting their level, however their style is not aligned with that of human players.
Expand Down
4 changes: 2 additions & 2 deletions agent1_zero_dnn/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from keras.models import load_model

from agent1_zero_dnn.game import print_board, winner, flip, flip_move, best_move, new_board, sample_move, shlomo_move
from agent1_zero_dnn.game import print_board, winner, flip, flip_move, best_move, new_board, sample_move, refined_move
from agent1_zero_dnn.tree_search import TreeSearchPredictor, temperature
from agent1_zero_dnn.config import CompareConfig

Expand Down Expand Up @@ -96,7 +96,7 @@ def compare(config, model1, model2, t, T, num_games):
probabilities = temperature(probabilities,T)
# print(probabilities)

move = shlomo_move(probabilities)
move = refined_move(probabilities)

for predictor in predictors:
predictor.make_move(move)
Expand Down
4 changes: 2 additions & 2 deletions agent1_zero_dnn/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def __init__(self, x, y) -> None:
def __repr__(self):
return '({}, {})'.format(self.x, self.y)

def shlomo_move(probabilities):
def refined_move(probabilities):
'''
Shlomo move from probability distribution.
'''
Expand All @@ -165,7 +165,7 @@ def shlomo_move(probabilities):
return pos.x, pos.y


def ori_moves(probabilities, set_len):
def refined_moves(probabilities, set_len):
'''
Ori moves from probability distribution. return set of 15 tuples
'''
Expand Down
2 changes: 1 addition & 1 deletion agent1_zero_dnn/learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from agent1_zero_dnn.tree_search import TreeSearchPredictor,temperature
from convertor.Convertor_ver4 import convert
from convertor.Convertor_ver4 import convert_last_moves
from agent1_zero_dnn.game import ori_moves,best_k_moves,new_board
from agent1_zero_dnn.game import refined_moves,best_k_moves,new_board
from agent1_zero_dnn.generate import fix_probabilities
import sys
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion agent1_zero_dnn/tree_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def visit(self, config, predictor, board, is_first_move):
probabilities = softmax(priorities)
temp_probabilities = temperature(probabilities, self.t)

#shlomo_probs = [(x+(random.randint(0,5)/10000)) for x in temp_probabilities]
#refined_probs = [(x+(random.randint(0,5)/10000)) for x in temp_probabilities]

#best_edge_index = np.argmax(shlomo_probs)
best_edge_index = numpy.random.choice(range(len(temp_probabilities)), p=temp_probabilities)
Expand Down
2 changes: 1 addition & 1 deletion agent1_zero_dnn/vs_wolve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import math
from keras.models import load_model
from agent1_zero_dnn.game import print_board, winner, flip, flip_move, best_move, new_board, sample_move, shlomo_move, fix_probabilities
from agent1_zero_dnn.game import print_board, winner, flip, flip_move, best_move, new_board, sample_move, refined_move, fix_probabilities
from agent1_zero_dnn.tree_search import TreeSearchPredictor, temperature
from agent1_zero_dnn.config import CompareConfig

Expand Down
2 changes: 1 addition & 1 deletion convertor/Convertor_ver3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# script gets HEX games in letters like: W[aa];B[bb];W[cd];B[dd])
# prints the board in every step

from convertor.avshalom_move import Move
from convertor.Move import Move
import copy

#filename = "../data_text_games_name_in_first_line/2062.txt"
Expand Down
2 changes: 1 addition & 1 deletion convertor/Convertor_ver4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# script gets HEX games in letters like: W[aa];B[bb];W[cd];B[dd])
# prints the board in every step

from convertor.avshalom_move import Move
from convertor.Move import Move
import copy

filename = "../data_text_games_name_in_first_line/1667.txt"
Expand Down
File renamed without changes.

0 comments on commit 4e500d3

Please sign in to comment.