Exemplo n.º 1
0
    def __init__(
        self,
        input_names: List[str],
        prediction_net: BlockType,
        batch_size: int,
        prediction_length: int,
        freq: str,
        ctx: mx.Context,
        input_transform: Transformation,
        lead_time: int = 0,
        forecast_generator: ForecastGenerator = SampleForecastGenerator(),
        output_transform: Optional[OutputTransform] = None,
        dtype: DType = np.float32,
    ) -> None:
        super().__init__(
            freq=freq,
            lead_time=lead_time,
            prediction_length=prediction_length,
        )

        self.input_names = input_names
        self.prediction_net = prediction_net
        self.batch_size = batch_size
        self.input_transform = input_transform
        self.forecast_generator = forecast_generator
        self.output_transform = output_transform
        self.ctx = ctx
        self.dtype = dtype
Exemplo n.º 2
0
 def __init__(
     self,
     prediction_net: BlockType,
     batch_size: int,
     prediction_length: int,
     freq: str,
     ctx: mx.Context,
     input_transform: Transformation,
     lead_time: int = 0,
     forecast_generator: ForecastGenerator = SampleForecastGenerator(),
     output_transform: Optional[Callable[[DataEntry, np.ndarray],
                                         np.ndarray]] = None,
     dtype: DType = np.float32,
 ) -> None:
     super().__init__(
         input_names=get_hybrid_forward_input_names(prediction_net),
         prediction_net=prediction_net,
         batch_size=batch_size,
         prediction_length=prediction_length,
         freq=freq,
         ctx=ctx,
         input_transform=input_transform,
         lead_time=lead_time,
         forecast_generator=forecast_generator,
         output_transform=output_transform,
         dtype=dtype,
     )
Exemplo n.º 3
0
 def __init__(
     self,
     prediction_net: BlockType,
     batch_size: int,
     prediction_length: int,
     freq: str,
     ctx: mx.Context,
     input_transform: Transformation,
     input_names: Optional[List[str]] = None,
     lead_time: int = 0,
     forecast_generator: ForecastGenerator = SampleForecastGenerator(),
     output_transform: Optional[
         Callable[[DataEntry, np.ndarray],
                  np.ndarray]] = DeepRenewalProcessSampleOutputTransform(),
     dtype: Type = np.float32,
 ) -> None:
     super().__init__(
         prediction_net=prediction_net,
         batch_size=batch_size,
         prediction_length=prediction_length,
         freq=freq,
         ctx=ctx,
         input_transform=input_transform,
         lead_time=lead_time,
         forecast_generator=forecast_generator,
         output_transform=output_transform,
         dtype=dtype,
     )
     if input_names is not None:
         self.input_names = input_names
Exemplo n.º 4
0
 def __init__(
     self,
     input_names: List[str],
     prediction_net: nn.Module,
     batch_size: int,
     prediction_length: int,
     freq: str,
     device: torch.device,
     input_transform: Transformation,
     forecast_generator: SampleForecastGenerator = SampleForecastGenerator(),
     output_transform: Optional[OutputTransform] = None,
 ) -> None:
     super().__init__(prediction_length, freq)
     self.input_names = input_names
     self.prediction_net = prediction_net
     self.batch_size = batch_size
     self.input_transform = input_transform
     self.forecast_generator = forecast_generator
     self.output_transform = output_transform
     self.device = device
Exemplo n.º 5
0
 def __init__(
         self,
         input_names: List[str],
         prediction_net: nn.Module,
         batch_size: int,
         prediction_length: int,
         freq: str,
         input_transform: Transformation,
         forecast_generator: ForecastGenerator = SampleForecastGenerator(),
         output_transform: Optional[OutputTransform] = None,
         lead_time: int = 0,
         device: Optional[torch.device] = torch.device("cpu"),
 ) -> None:
     super().__init__(prediction_length, freq=freq, lead_time=lead_time)
     self.input_names = input_names
     self.prediction_net = prediction_net.to(device)
     self.batch_size = batch_size
     self.input_transform = input_transform
     self.forecast_generator = forecast_generator
     self.output_transform = output_transform
     self.device = device