tempor.methods.prediction.one_off.classification.plugin_cde_classifier module¶
One-off classification plugin based on Neural Controlled Differential Equations for Irregular Time Series.
-
class tempor.methods.prediction.one_off.classification.plugin_cde_classifier.CDEClassifierParams(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, atol: float =0.01, rtol: float =0.01, interpolation: Literal[cubic] | Literal[linear] ='cubic', 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
CDEClassifier.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
-
n_iter_print : int =
100¶ Number of iterations after which to print updates and check the validation loss.
- class tempor.methods.prediction.one_off.classification.plugin_cde_classifier.CDEClassifier(**params: Any)[source]¶
Bases:
BaseOneOffClassifierNeural Controlled Differential Equations for Irregular Time Series.
- Parameters:¶
- **params : Any
Parameters and defaults as defined in
CDEClassifierParams.
Example
>>> from tempor import plugin_loader >>> >>> dataset = plugin_loader.get("prediction.one_off.sine", plugin_type="datasource").load() >>> >>> # Load the model: >>> model = plugin_loader.get("prediction.one_off.classification.cde_classifier", n_iter=50) >>> >>> # Train: >>> model.fit(dataset) CDEClassifier(...) >>> >>> # Predict: >>> assert model.predict(dataset).numpy().shape == (len(dataset), 1)References
“Neural Controlled Differential Equations for Irregular Time Series”, Patrick Kidger, James Morrill, James Foster, Terry Lyons.
-
category : ClassVar[plugin_typing.PluginCategory] =
'prediction.one_off.classification'¶ Plugin category, such as
'prediction.one_off.classification'. Must be set by the plugin class using@register_plugin.
-
name : ClassVar[plugin_typing.PluginName] =
'cde_classifier'¶ 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
CDEClassifierParams
- params : CDEClassifierParams¶