docstr: Remembers samples of spectrograms and the batch for logging purposes
  Arguments
  ---------
  batch: tuple
      a training batch
  predictions: tuple
      predictions (raw output of the FastSpeech2
       model)
docstr_tok: ["Remembers","samples","of","spectrograms","and","the","batch","for","logging","purposes","Arguments","--","--","--","--","-","batch",":","tuple","a","training","batch","predictions",":","tuple","predictions","(","raw","output","of","the","FastSpeech2","model",")"]
code: def _remember_sample(self, batch, predictions):
      """Remembers samples of spectrograms and the batch for logging purposes
      Arguments
      ---------
      batch: tuple
          a training batch
      predictions: tuple
          predictions (raw output of the FastSpeech2
           model)
      """
      (
          tokens,
          spectogram,
          durations,
          pitch,
          energy,
          mel_lengths,
          input_lengths,
          spn_labels,
          labels,
          wavs,
      ) = batch
      (
          mel_post,
          postnet_mel_out,
          predict_durations,
          predict_pitch,
          predict_avg_pitch,
          predict_energy,
          predict_avg_energy,
          predict_mel_lens,
          spn_preds,
      ) = predictions
      self.hparams.progress_sample_logger.remember(
          target=self.process_mel(spectogram, mel_lengths),
          output=self.process_mel(postnet_mel_out, mel_lengths),
          raw_batch=self.hparams.progress_sample_logger.get_batch_sample(
              {
                  "tokens": tokens,
                  "input_lengths": input_lengths,
                  "mel_target": spectogram,
                  "mel_out": postnet_mel_out,
                  "mel_lengths": predict_mel_lens,
                  "durations": durations,
                  "predict_durations": predict_durations,
                  "labels": labels,
                  "wavs": wavs,
              }
          ),
      )
  
imports: import os
  import sys
  import torch
  import logging
  import torchaudio
  import numpy
  import speechbrain
  from speechbrain.inference.vocoders import HIFIGAN
  from pathlib import Path
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.data_utils import scalarize
  from speechbrain.inference.text import GraphemeToPhoneme
label_desc: Use image node_id 5 for calling the FastSpeech2Brain obj's underlying member method code with example usage: obj._remember_sample(batch, predictions) without return types