class_docstr: Helper object for creating Attention visualizations.
class_docstr_tok: ["Helper","object","for","creating","Attention","visualizations","."]
code: def __init__(
      self, hparams_set, model_name, data_dir, problem_name, beam_size=1
  ):
      inputs, targets, samples, att_mats = build_model(
          hparams_set,
          model_name,
          data_dir,
          problem_name,
          beam_size=beam_size,
      )
  
      # Fetch the problem
      ende_problem = problems.problem(problem_name)
      encoders = ende_problem.feature_encoders(data_dir)
  
      self.inputs = inputs
      self.targets = targets
      self.att_mats = att_mats
      self.samples = samples
      self.encoders = encoders
  
file_path: tensor2tensor/tensor2tensor/visualization/visualization.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor import models
  from tensor2tensor import problems
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import trainer_lib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 to create a new AttentionVisualizer object from inherited base classes: object with example: obj = AttentionVisualizer(hparams_set, model_name, data_dir, problem_name, beam_size)