class_docstr: seq2seq recurrent neural network, implemented using TFLearn.
class_docstr_tok: ["seq2seq","recurrent","neural","network",",","implemented","using","TFLearn","."]
docstr: Compute accuracy of the prediction, based on the true labels.  Use the average number of equal
  values.
docstr_tok: ["Compute","accuracy","of","the","prediction",",","based","on","the","true","labels",".","Use","the","average","number","of","equal","values","."]
code: def accuracy(
      self, y_pred, y_true, x_in
  ):  # y_pred is [-1, self.out_seq_len, num_decoder_symbols]; y_true is [-1, self.out_seq_len]
      """
      Compute accuracy of the prediction, based on the true labels.  Use the average number of equal
      values.
      """
      pred_idx = tf.to_int32(
          tf.argmax(y_pred, 2)
      )  # [-1, self.out_seq_len]
      if self.verbose > 2:
          print("my_accuracy pred_idx = %s" % pred_idx)
      accuracy = tf.reduce_mean(
          tf.cast(tf.equal(pred_idx, y_true), tf.float32), name="acc"
      )
      return accuracy
  
imports: from __future__ import division, print_function
  import os
  import sys
  import tflearn
  import argparse
  import json
  import numpy
  import tensorflow.compat.v1
  from tensorflow.contrib.legacy_seq2seq.python.ops import seq2seq
  from tensorflow.python.ops import rnn_cell
label_desc: Use image node_id 4 for calling the TFLearnSeq2Seq obj's underlying member method code with example usage: obj.accuracy(y_pred, y_true, x_in) and returns: accuracy