gluonts.mx.model.tpp.predictor module#
- class gluonts.mx.model.tpp.predictor.PointProcessGluonPredictor(input_names: typing.List[str], prediction_net: mxnet.gluon.block.Block, batch_size: int, prediction_interval_length: float, freq: str, ctx: mxnet.context.Context, input_transform: gluonts.transform._base.Transformation, dtype: typing.Type = <class 'numpy.float32'>, forecast_generator: gluonts.model.forecast_generator.ForecastGenerator = <gluonts.mx.model.tpp.predictor.PointProcessForecastGenerator object>, **kwargs)[source]#
Bases:
gluonts.mx.model.predictor.GluonPredictor
Predictor object for marked temporal point process models.
TPP predictions differ from standard discrete-time models in several regards. First, at least for now, only sample forecasts implementing PointProcessSampleForecast are available. Similar to TPP Estimator objects, the Predictor works with
prediction_interval_length
as opposed toprediction_length
.The predictor also accounts for the fact that the prediction network outputs a 2-tuple of Tensors, for the samples themselves and their valid_length.
- Parameters
prediction_interval_length – The length of the prediction interval
- as_symbol_block_predictor(batch: Optional[Dict[str, Any]] = None, dataset: Optional[gluonts.dataset.Dataset] = None) gluonts.mx.model.predictor.SymbolBlockPredictor [source]#
Returns a variant of the current
GluonPredictor
backed by a Gluon SymbolBlock. If the current predictor is already aSymbolBlockPredictor
, it just returns itself.One of batch or datset must be set.
- Parameters
batch – A batch of data to use for the required forward pass after the hybridize() call of the underlying network.
dataset – Dataset from which a batch is extracted if batch is not set.
- Returns
A predictor derived from the current one backed by a SymbolBlock.
- Return type
- hybridize(batch: Dict[str, Any]) None [source]#
Hybridizes the underlying prediction network.
- Parameters
batch – A batch of data to use for the required forward pass after the hybridize() call.
- predict(dataset: gluonts.dataset.Dataset, num_samples: Optional[int] = None, num_workers: Optional[int] = None, num_prefetch: Optional[int] = None, **kwargs) Iterator[gluonts.model.forecast.Forecast] [source]#
Compute forecasts for the time series in the provided dataset. This method is not implemented in this abstract class; please use one of the subclasses. :param dataset: The dataset containing the time series to predict.
- Returns
Iterator over the forecasts, in the same order as the dataset iterable was provided.
- Return type
Iterator[Forecast]