Added comments for Christoffer!
This commit is contained in:
parent
1aedc23de1
commit
6131d5b5f4
|
@ -307,6 +307,7 @@ class Network:
|
||||||
|
|
||||||
list_of_moves = []
|
list_of_moves = []
|
||||||
|
|
||||||
|
# Prepping of data
|
||||||
for idx, board in enumerate(boards):
|
for idx, board in enumerate(boards):
|
||||||
all_board_moves = []
|
all_board_moves = []
|
||||||
for roll in all_rolls:
|
for roll in all_rolls:
|
||||||
|
@ -317,14 +318,16 @@ class Network:
|
||||||
list_of_moves.append(np.array(all_board_moves))
|
list_of_moves.append(np.array(all_board_moves))
|
||||||
|
|
||||||
|
|
||||||
|
print(time.time() - start)
|
||||||
|
|
||||||
|
start = time.time()
|
||||||
|
# Running data through networks
|
||||||
all_scores = [self.model.predict_on_batch(board) for board in list_of_moves]
|
all_scores = [self.model.predict_on_batch(board) for board in list_of_moves]
|
||||||
transformed_scores = [x if player == 1 else (1-x) for x in all_scores]
|
transformed_scores = [x if player == 1 else (1-x) for x in all_scores]
|
||||||
|
|
||||||
scores_means = [tf.reduce_mean(score) for score in all_scores]
|
scores_means = [tf.reduce_mean(score) for score in all_scores]
|
||||||
transformed_means = [tf.reduce_mean(score) for score in transformed_scores]
|
transformed_means = [tf.reduce_mean(score) for score in transformed_scores]
|
||||||
|
|
||||||
print(time.time() - start)
|
print(time.time() - start)
|
||||||
|
|
||||||
return ([scores_means, transformed_means])
|
return ([scores_means, transformed_means])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user