gluonts.model.tpp.predictor module

class gluonts.model.tpp.predictor.PointProcessForecastGenerator[source]

Bases: gluonts.model.forecast_generator.ForecastGenerator

class gluonts.model.tpp.predictor.PointProcessGluonPredictor(input_names: 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: gluonts.core.component.DType = <class 'numpy.float32'>, forecast_generator: gluonts.model.forecast_generator.ForecastGenerator = <gluonts.model.tpp.predictor.PointProcessForecastGenerator object>, **kwargs)[source]


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 to prediction_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.


prediction_interval_length – The length of the prediction interval

as_symbol_block_predictor(batch: Optional[Dict[str, Any]] = None, dataset: Optional[gluonts.dataset.common.Dataset] = None) →[source]

Returns a variant of the current GluonPredictor backed by a Gluon SymbolBlock. If the current predictor is already a SymbolBlockPredictor, it just returns itself.

One of batch or datset must be set.

  • 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.


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.


batch – A batch of data to use for the required forward pass after the hybridize() call.

predict(dataset: gluonts.dataset.common.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.


Iterator over the forecasts, in the same order as the dataset iterable was provided.

Return type


serialize_prediction_net(path: pathlib.Path) → None[source]