import tensorflow as tf

      in_size: size of the hidden state vectors
      mats: list of hidden state vectors
    """
    pred_mat = tf.get_variable('pred_mat',
                               [in_size, self._out_vocab_size])
    pred_bias = tf.get_variable('pred_bias', [self._out_vocab_size])

    # Make a prediction on every word.
    def GetWordPred(o_):
      logits = tf.nn.xw_plus_b(o_, pred_mat, pred_bias)
      return tf.nn.softmax(logits)

    #self.preds_by_word1 = tf.pack([GetWordPred(o_) for o_ in mats])
    #self.preds_by_word = tf.reshape(self.preds_by_word1, self.y.get_shape())
    #self.probs = tf.mul(tf.expand_dims(self._mask,2), self.preds_by_word)

    self.preds_by_word = tf.pack([GetWordPred(o_) for o_ in mats])
    self.preds_by_instance = tf.pack([self.preds_by_word[:,i,:] for i in range(self.preds_by_word.get_shape()[1])])
