docstr: Gets called when a stage (either training, validation, test) starts.
code: def on_stage_end(self, stage, stage_loss, epoch=None):
      "Gets called when a stage (either training, validation, test) starts."
      if stage == sb.Stage.TRAIN:
          self.train_loss = stage_loss
      if stage == sb.Stage.VALID:
          print("Epoch %d complete" % epoch)
          print("Train loss: %.2f" % self.train_loss)
      if stage != sb.Stage.TRAIN:
          print(stage, "loss: %.2f" % stage_loss)
          perplexity = math.e**stage_loss
          print(stage, "perplexity: %.2f" % perplexity)
  
file_path: speechbrain/tests/integration/LM_RNN/example_lm_rnn_experiment.py
imports: import math
  import pathlib
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 3 for calling the LMBrain obj's underlying member method code with example usage: obj.on_stage_end(stage, stage_loss, epoch) without return types