code: def test_composite_issm_h_default():
      issm = CompositeISSM.get_from_freq(freq="H")
  
      assert issm.latent_dim() == 2 + 24 + 7
      assert issm.output_dim() == 1
  
      time_features = issm.time_features()
  
      assert len(time_features) == 3
  
      time_indices = [
          pd.date_range("2020-01-01 21:00:00", periods=10, freq="H"),
          pd.date_range("2020-01-02 03: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_hod = [
          [21, 22, 23, 0, 1, 2, 3, 4, 5, 6],
          [3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
      ]
  
      season_indices_dow = [[2] * 3 + [3] * 7, [3] * 10]
  
      for item in range(2):
          for time in range(10):
              expected_coeff = mx.nd.concat(
                  mx.nd.ones((1, 2)),
                  mx.nd.one_hot(
                      mx.nd.array([season_indices_hod[item][time]]), 24
                  ),
                  mx.nd.one_hot(
                      mx.nd.array([season_indices_dow[item][time]]), 7
                  ),
                  dim=-1,
              )
  
              sliced_emission_coeff = mx.nd.slice(
                  emission_coeff,
                  begin=(item, time, None, None),
                  end=(item + 1, time + 1, None, None),
              )
              assert (
                  (sliced_emission_coeff == expected_coeff)
                  .asnumpy()
                  .all()
              )
  
              sliced_transition_coeff = mx.nd.slice(
                  transition_coeff,
                  begin=(item, time, None, None),
                  end=(item + 1, time + 1, None, None),
              )
              expected_transition_coeff = mx.nd.eye(2 + 24 + 7)
              expected_transition_coeff[0, 1] = 1
              assert (
                  (sliced_transition_coeff == expected_transition_coeff)
                  .asnumpy()
                  .all()
              )
  
              sliced_innovation_coeff = mx.nd.slice(
                  innovation_coeff,
                  begin=(item, time, None),
                  end=(item + 1, time + 1, None),
              )
              assert (
                  (sliced_innovation_coeff == expected_coeff)
                  .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 6 for calling a global function with example usage: test_composite_issm_h_default() without return types