Esempio n. 1
0
    def __init__(self, interface):
        super().__init__(interface)
        self.bootstrap_state_input = tf.placeholder(
            tf.float32, [*self.interface.state_shape])

        self.features = parts.conv_body(self.state_input)
        self.nonspacial_probs, self.spacial_probs_x, self.spacial_probs_y = self._probs_from_features(
            self.features)
Esempio n. 2
0
 def features(self):
     conv_features = parts.conv_body(self.state_input)
     unit_features = tf.reduce_sum(self.self_attention(
         self.unit_embeddings_input, bias=0),
                                   axis=1)
     logits = tf.concat(
         [conv_features, unit_features, self.other_features_input], axis=1)
     logits = tf.layers.dense(logits,
                              units=200,
                              activation=tf.nn.leaky_relu,
                              name='feature_layer')
     logits = tf.layers.dense(logits,
                              units=200,
                              activation=tf.nn.tanh,
                              name='feature_layer2')
     return logits
Esempio n. 3
0
 def features(self):
     conv_features = parts.conv_body(self.state_input)
     unit_features = tf.reduce_sum(self.self_attention(
         self.unit_embeddings_input, bias=0),
                                   axis=1)
     return tf.concat([conv_features, unit_features], axis=1)
Esempio n. 4
0
 def bootstrap_value(self):
     return tf.squeeze(parts.value_head(
         parts.conv_body(tf.expand_dims(self.bootstrap_state_input,
                                        axis=0))),
                       axis=0)