class_docstr: Abstract base class to implement feed-forward networks for probabilistic
  time series prediction.
  
  This class does not implement hybrid_forward: this is delegated
  to the two subclasses SimpleFeedForwardTrainingNetwork and
  SimpleFeedForwardPredictionNetwork, that define respectively how to
  compute the loss and how to generate predictions.
  
  Parameters
  ----------
  num_hidden_dimensions
      Number of hidden nodes in each layer.
  prediction_length
      Number of time units to predict.
  context_length
      Number of time units that condition the predictions.
  batch_normalization
      Whether to use batch normalization.
  mean_scaling
      Scale the network input by the data mean and the network output by
      its inverse.
  distr_output
      Distribution to fit.
  kwargs
class_docstr_tok: ["Abstract","base","class","to","implement","feed-forward","networks","for","probabilistic","time","series","prediction",".","This","class","does","not","implement","hybrid_forward",":","this","is","delegated","to","the","two","subclasses","SimpleFeedForwardTrainingNetwork","and","SimpleFeedForwardPredictionNetwork",",","that","define","respectively","how","to","compute","the","loss","and","how","to","generate","predictions",".","Parameters","--","--","--","--","--","num_hidden_dimensions","Number","of","hidden","nodes","in","each","layer",".","prediction_length","Number","of","time","units","to","predict",".","context_length","Number","of","time","units","that","condition","the","predictions",".","batch_normalization","Whether","to","use","batch","normalization",".","mean_scaling","Scale","the","network","input","by","the","data","mean","and","the","network","output","by","its","inverse",".","distr_output","Distribution","to","fit",".","kwargs"]
code: def __init__(
      self,
      num_hidden_dimensions: List[int],
      prediction_length: int,
      context_length: int,
      batch_normalization: bool,
      mean_scaling: bool,
      distr_output: DistributionOutput,
  ) -> None:
      super().__init__()
  
      self.num_hidden_dimensions = num_hidden_dimensions
      self.prediction_length = prediction_length
      self.context_length = context_length
      self.batch_normalization = batch_normalization
      self.mean_scaling = mean_scaling
      self.distr_output = distr_output
  
      modules = []
      dims = self.num_hidden_dimensions
      for i, units in enumerate(dims[:-1]):
          if i == 0:
              input_size = context_length
          else:
              input_size = dims[i - 1]
          modules += [nn.Linear(input_size, units), nn.ReLU()]
          if self.batch_normalization:
              modules.append(nn.BatchNorm1d(units))
      if len(dims) == 1:
          modules.append(
              nn.Linear(context_length, dims[-1] * prediction_length)
          )
      else:
          modules.append(
              nn.Linear(dims[-2], dims[-1] * prediction_length)
          )
      modules.append(
          LambdaLayer(
              lambda o: torch.reshape(
                  o, (-1, prediction_length, dims[-1])
              )
          )
      )
      self.mlp = nn.Sequential(*modules)
  
      self.distr_args_proj = self.distr_output.get_args_proj(dims[-1])
  
      self.scaler = MeanScaler() if mean_scaling else NOPScaler()
  
file_path: gluonts/src/gluonts/nursery/robust-mts-attack/pts/model/simple_feedforward/simple_feedforward_network.py
imports: from typing import List
  import torch
  import torch.nn
  from torch.distributions import Distribution
  from gluonts.core.component import validated
  from gluonts.torch.modules.distribution_output import DistributionOutput
  from gluonts.torch.modules.lambda_layer import LambdaLayer
  from pts.modules import MeanScaler, NOPScaler
label_desc: Use image node_id 1 to create a new SimpleFeedForwardNetworkBase object from inherited base classes: nn with example: obj = SimpleFeedForwardNetworkBase(num_hidden_dimensions, prediction_length, context_length, batch_normalization, mean_scaling, distr_output)