def __init__(self, train_data_loader, batch_size, max_length=120):
    framework.re_model.__init__(self, train_data_loader, batch_size, max_length)
    self.weights = tf.placeholder(tf.float32, shape=(), name='weights_scalar')
    x = network.embedding.word_position_embedding(self.word, self.word_vec_mat, self.pos1, self.pos2)
    x_train = network.encoder.cnn(x, keep_prob=0.5)
    x_test = network.encoder.cnn(x, keep_prob=1.0)
    self._train_logit = network.selector.instance(x_train, 2, keep_prob=0.5)
    self._test_logit = network.selector.instance(x_test, 2, keep_prob=1.0)
    self._loss = network.classifier.softmax_cross_entropy(self._train_logit, self.ins_label, 2, weights=self.weights)
def __init__(self, train_data_loader, batch_size, max_length=120):
    framework.re_model.__init__(self, train_data_loader, batch_size, max_length)
    self.weights = tf.placeholder(tf.float32, shape=(), name='weights_scalar')
    x = network.embedding.word_position_embedding(self.word, self.word_vec_mat, self.pos1, self.pos2)
    x_train = network.encoder.cnn(x, keep_prob=0.5)
    x_test = network.encoder.cnn(x, keep_prob=1.0)
    self._train_logit = network.selector.instance(x_train, 2, keep_prob=0.5)
    self._test_logit = network.selector.instance(x_test, 2, keep_prob=1.0)
    self._loss = network.classifier.softmax_cross_entropy(self._train_logit, self.ins_label, 2, weights=self.weights)