<commit_before>from __future__ import unicode_literals

import tensorflow as tf


INPUT_DIMENSION = 768  # 8 x 8 squares x 12 piece types
HIDDEN_UNITS = 2048
KAPPA = 2.0  # Emphasizes f(p) = -f(q)
INITIAL_LEARNING_RATE = 0.001  # Default Adam learning rate
DROPOUT_RATE = 0.5


class ChessDNNEstimator(object):

    def __init__(self):
        with tf.variable_scope("input"):
            self.X = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X')
            self.X_parent = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_parent')
            self.X_observed = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_observed')
            self.X_random = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_random')

        with tf.variable_scope("f_p"):
            self.training = tf.placeholder_with_default(False, shape=(), name='training')
            self.f = self._get_evaluation_function(self.X)
            tf.get_variable_scope().reuse_variables()
            self.f_parent = self._get_evaluation_function(self.X_parent)
            self.f_observed = self._get_evaluation_function(self.X_observed)
            self.f_random = self._get_evaluation_function(self.X_random)

        with tf.name_scope('loss'):
            self.loss = self._get_loss()

        with tf.name_scope('train'):
            self.training_op = self._get_training_op()

    def train(self, session, X_parent, X_observed, X_random):
        session.run(self.training_op, feed_dict={<commit_msg>Put more emphasize on f(p) = -f(q)<commit_after>from __future__ import unicode_literals

import tensorflow as tf


INPUT_DIMENSION = 768  # 8 x 8 squares x 12 piece types
HIDDEN_UNITS = 2048
KAPPA = 10.0  # Emphasizes f(p) = -f(q)
INITIAL_LEARNING_RATE = 0.001  # Default Adam learning rate
DROPOUT_RATE = 0.5


class ChessDNNEstimator(object):

    def __init__(self):
        with tf.variable_scope("input"):
            self.X = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X')
            self.X_parent = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_parent')
            self.X_observed = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_observed')
            self.X_random = tf.placeholder(tf.float32, shape=(None, INPUT_DIMENSION), name='X_random')

        with tf.variable_scope("f_p"):
            self.training = tf.placeholder_with_default(False, shape=(), name='training')
            self.f = self._get_evaluation_function(self.X)
            tf.get_variable_scope().reuse_variables()
            self.f_parent = self._get_evaluation_function(self.X_parent)
            self.f_observed = self._get_evaluation_function(self.X_observed)
            self.f_random = self._get_evaluation_function(self.X_random)

        with tf.name_scope('loss'):
            self.loss = self._get_loss()

        with tf.name_scope('train'):
            self.training_op = self._get_training_op()

    def train(self, session, X_parent, X_observed, X_random):
        session.run(self.training_op, feed_dict={
{'fraction_non_alphanumeric': 0.1154094132817537, 'fraction_numerical': 0.01773049645390071, 'mean_word_length': 3.3097222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '1969434', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1016, 'n_words': 184}