<jupyter_start><jupyter_text>Verify<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import sys, json
import numpy as np
import tensorflow as tf
if ".." not in sys.path:
    sys.path.append("..")
import chomp_rules
import model
import engine
game = json.loads(open("../run1/games/games-001.json").readline())
config = chomp_rules.ChompGameConfig(16, 16)
to_board = lambda b: chomp_rules.ChompState(config=config, limits=b[:], to_move=1)
new_board = to_board(game["boards"][0])
for board_desc, move in zip(game["boards"], game["moves"]):
    move = map(int, move.split(","))
    assert new_board.limits == board_desc
    new_board = to_board(board_desc)
    new_board.apply_move(move)
net = model.Network("net/")
sess = tf.Session()
sess.run(tf.global_variables_initializer())
model.load_model(sess, "../run1/models/model-001/")
board = to_board(game["boards"][0])
print board
features = engine.board_to_features(board)
p, v = sess.run(
    [net.policy_output, net.value_output],
    feed_dict={
        net.input_ph: [features],
        net.is_training_ph: False,
    },
)
features[:,:,1]
plt.matshow(p[0])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.157254561251086, 'fraction_numerical': 0.014769765421372719, 'mean_word_length': 5.193548387096774, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '445984', 'license': 'MIT', 'n_tokens_mistral': 430, 'n_tokens_neox': 422, 'n_words': 81, 'path': 'notebooks/Verify.ipynb', 'repo_name': 'petersn/ChompZero', 'size': '1151'}