output_size = preact.shape[2]
preact = preact.reshape([num_time_steps * num_sequences,
output_size])
self.output_probs = tensor.nnet.softmax(preact)
self.output_probs = self.output_probs.reshape([num_time_steps,
num_sequences,
output_size])
if self.network.mode.is_distribution():
return
// We should predict probabilities of the target outputs, i.e. the words
// at the next time step.
if self.network.mode.is_target_words():
output_probs = self.output_probs
target_class_ids = self.network.target_class_ids
else:
output_probs = self.output_probs[:-1]
target_class_ids = self.network.class_input[1:]
num_time_steps -= 1
assert_op = tensor.opt.Assert(
After Change
output_probs = self._get_softmax(layer_input)
if not self.network.mode.is_target_words():
output_probs = output_probs[:-1]
target_class_ids = target_class_ids[1:]
assert_op = tensor.opt.Assert(
"Mismatch in mini-batch and target classes shape.")