code: def _smooth_loss(loss, beta=0.9):
      smoothed_loss = np.zeros_like(loss)
      smoothed_loss[0] = loss[0]
      for i in range(1, len(loss)):
          smoothed_loss[i] = (
              smoothed_loss[i - 1] * beta + (1 - beta) * loss[i]
          )
      return smoothed_loss
  
imports: from __future__ import annotations
  import logging
  import math
  import os
  import sys
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Iterable, Optional, Union
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from neuralprophet import utils_torch
  from neuralprophet.hdays_utils import get_country_holidays
  from neuralprophet.logger import ProgressBar
label_desc: Use image node_id 24 for calling a global function with example usage: _smooth_loss(loss, beta) and returns: smoothed_loss