code: def test_seasonality_issm_h():
      issm = SeasonalityISSM(
          num_seasons=12, time_feature=month_of_year_index
      )
  
      assert issm.latent_dim() == 12
      assert issm.output_dim() == 1
  
      time_features = issm.time_features()
  
      assert len(time_features) == 1
  
      time_indices = [
          pd.date_range("2019-01-01 21:00:00", periods=10, freq="H"),
          pd.date_range("2019-01-31 22:00:00", periods=10, freq="H"),
      ]
  
      features = mx.nd.array(
          np.stack(
              [
                  np.stack(
                      [f(time_index) for f in time_features], axis=-1
                  )
                  for time_index in time_indices
              ],
              axis=0,
          )
      )
  
      (
          emission_coeff,
          transition_coeff,
          innovation_coeff,
      ) = issm.get_issm_coeff(features)
  
      season_indices = [[0] * 10, [0] * 2 + [1] * 8]
  
      for item in range(2):
          for time in range(10):
              season_indicator = mx.nd.one_hot(
                  mx.nd.array([season_indices[item][time]]), 12
              )
  
              sliced_emission_coeff = mx.nd.slice(
                  emission_coeff,
                  begin=(item, time, None, None),
                  end=(item + 1, time + 1, None, None),
              )
              assert (
                  (sliced_emission_coeff == season_indicator)
                  .asnumpy()
                  .all()
              )
  
              sliced_transition_coeff = mx.nd.slice(
                  transition_coeff,
                  begin=(item, time, None, None),
                  end=(item + 1, time + 1, None, None),
              )
              assert (
                  (sliced_transition_coeff == mx.nd.eye(12))
                  .asnumpy()
                  .all()
              )
  
              sliced_innovation_coeff = mx.nd.slice(
                  innovation_coeff,
                  begin=(item, time, None),
                  end=(item + 1, time + 1, None),
              )
              assert (
                  (sliced_innovation_coeff == season_indicator)
                  .asnumpy()
                  .all()
              )
  
file_path: gluonts/test/mx/model/deepstate/test_issm.py
imports: import mxnet
  import numpy
  import pandas
  from gluonts.mx.model.deepstate.issm import CompositeISSM, LevelISSM, LevelTrendISSM, SeasonalityISSM, ZeroFeature
  from gluonts.time_feature import day_of_week_index, month_of_year_index
label_desc: Use image node_id 4 for calling a global function with example usage: test_seasonality_issm_h() without return types