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]

Bases: gluonts.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 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.

Finally, this class uses a VariableLengthInferenceDataLoader as opposed to the default InferenceDataLoader.

Parameters

prediction_interval_length – The length of the prediction interval

as_symbol_block_predictor(batch: Dict[str, Any]) → gluonts.model.predictor.SymbolBlockPredictor[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.

Parameters

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

Returns

A predictor derived from the current one backed by a SymbolBlock.

Return type

SymbolBlockPredictor

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: Iterable[Dict[str, Any]], 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.

Parameters

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]

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