I am trying to simulate the similarity of sentences using tensor flow. The ideal thing is that they first submit the concatenated sentence to rnn and then feed the output of rnn to softmax to make binary classification similar or not. I am making some negative changes to the PTB language model example , but the cost will not decrease as expected.
cost: 0.694479 cost: 0.695012 cost: 0.6955 ...
The code is as follows. Any help would be greatly appreciated.
class PTBModel(object): """The PTB model.""" def __init__(self, is_training, config): self.batch_size = batch_size = config.batch_size self.num_steps = num_steps = config.num_steps size = config.hidden_size vocab_size = config.vocab_size label_size = 2 self._input_data = tf.placeholder(tf.int32, [batch_size, num_steps], name="inputs")
python deep-learning machine-learning tensorflow
Tilney
source share