tempor.methods.prediction.one_off.regression.plugin_laplace_regressor module¶
One-off regression plugin based on “Neural Laplace: Learning diverse classes of differential equations in the Laplace domain”.
-
class tempor.methods.prediction.one_off.regression.plugin_laplace_regressor.LaplaceODERegressorParams(n_units_hidden: int =
100, n_layers_hidden: int =1, nonlin: Literal[none] | Literal[elu] | Literal[relu] | Literal[leaky_relu] | Literal[selu] | Literal[tanh] | Literal[sigmoid] | Literal[softmax] | Literal[gumbel_softmax] ='relu', dropout: float =0, ilt_reconstruction_terms: int =33, ilt_algorithm: Literal[fourier] | Literal[dehoog] | Literal[cme] | Literal[fixed_tablot] | Literal[stehfest] ='fourier', lr: float =0.001, weight_decay: float =0.001, n_iter: int =1000, batch_size: int =500, n_iter_print: int =100, random_state: int =0, patience: int =10, clipping_value: int =1, train_ratio: float =0.8, device: str | None =None, dataloader_sampler: Literal[BatchSampler] | Literal[RandomSampler] | Literal[Sampler] | Literal[SequentialSampler] | Literal[SubsetRandomSampler] | Literal[WeightedRandomSampler] | None =None)[source]¶ Bases:
objectInitialization parameters for
LaplaceODERegressor.Number of hidden units.
Number of hidden layers.
-
nonlin : Literal[none] | Literal[elu] | Literal[relu] | Literal[leaky_relu] | Literal[selu] | Literal[tanh] | Literal[sigmoid] | Literal[softmax] | Literal[gumbel_softmax] =
'relu'¶ -
- Type:¶
Activation for hidden layers. Available options
-
ilt_reconstruction_terms : int =
33¶ Number of ILT reconstruction terms, i.e. the number of complex \(s\) points in
laplace_rep_functo reconstruct a single time point.
-
ilt_algorithm : Literal[fourier] | Literal[dehoog] | Literal[cme] | Literal[fixed_tablot] | Literal[stehfest] =
'fourier'¶ Inverse Laplace transform algorithm to use. Available are {
fourier,dehoog,cme,fixed_tablot,stehfest}.
-
n_iter_print : int =
100¶ Number of iterations after which to print updates and check the validation loss.
- class tempor.methods.prediction.one_off.regression.plugin_laplace_regressor.LaplaceODERegressor(**params: Any)[source]¶
Bases:
BaseOneOffRegressorInverse Laplace Transform (ILT) algorithms implemented in PyTorch. Backpropagation through differential equation (DE) solutions in the Laplace domain is supported using the Riemann stereographic projection for better global representation of the complex Laplace domain.
- Parameters:¶
- **params : Any
Parameters and defaults as defined in
LaplaceODERegressorParams.
Example
>>> from tempor import plugin_loader >>> >>> dataset = plugin_loader.get("prediction.one_off.google_stocks", plugin_type="datasource").load() >>> >>> # Load the model: >>> model = plugin_loader.get("prediction.one_off.regression.laplace_ode_regressor", n_iter=50) >>> >>> # Train: >>> model.fit(dataset) LaplaceODERegressor(...) >>> >>> # Predict: >>> assert model.predict(dataset).numpy().shape == (len(dataset), 1)References
“Neural Laplace: Learning diverse classes of differential equations in the Laplace domain”, Holt, Samuel I and Qian, Zhaozhi and van der Schaar, Mihaela.
-
category : ClassVar[plugin_typing.PluginCategory] =
'prediction.one_off.regression'¶ Plugin category, such as
'prediction.one_off.classification'. Must be set by the plugin class using@register_plugin.
-
name : ClassVar[plugin_typing.PluginName] =
'laplace_ode_regressor'¶ Plugin name, such as
'my_nn_classifier'. Must be set by the plugin class using@register_plugin.
-
plugin_type : ClassVar[plugin_typing.PluginTypeArg] =
'method'¶ Plugin type, such as
'method'. May be optionally set by the plugin class using@register_plugin, else will set the default plugin type.
- ParamsDefinition¶
alias of
LaplaceODERegressorParams
- params : LaplaceODERegressorParams¶