import tensorflow as tf

class ModelOwner:

    LEARNING_RATE = 0.1
    ITERATIONS = 60000 // 30

    def __init__(self, player_name):
        self.player_name = player_name

        with tf.device(tfe.get_config().get_player(player_name).device_name):
            self._initialize_weights()

    def _initialize_weights(self):
        with tf.name_scope('parameters'):
            self.w0 = tf.Variable(tf.random_normal([28 * 28, 512]))
            self.b0 = tf.Variable(tf.zeros([512]))
            self.w1 = tf.Variable(tf.random_normal([512, 10]))
            self.b1 = tf.Variable(tf.zeros([10]))

    def _build_model(self, x, y):
        w0 = self.w0.read_value()
        b0 = self.b0.read_value()
        w1 = self.w1.read_value()
        b1 = self.b1.read_value()
        params = (w0, b0, w1, b1)
