def TimeSeriesModel(
    seq_model,
    low=0.0,
    high=1.0,
    precision=2,
    vocab_size=64,
    significance_decay=0.7,
    mode='train',
):
  """Simplified constructor for SerializedModel, for time series prediction."""
  # Model scalar time series.
  obs_srl = space_serializer.BoxSpaceSerializer(
      space=gym.spaces.Box(shape=(), low=low, high=high),
      vocab_size=vocab_size,
      precision=precision,
  )
  # Artifact of the fact that we must provide some actions.
  # TODO(pkozakowski): Remove this requirement.
  act_srl = space_serializer.DiscreteSpaceSerializer(
      space=gym.spaces.Discrete(n=1), vocab_size=1
  )
  seq_model = functools.partial(seq_model, vocab_size=vocab_size)
  return SerializedModel(seq_model, obs_srl, act_srl, significance_decay, mode)
Simplified constructor for SerializedModel, for time series prediction.
trax/rl/serialization_utils.py