FCNClassifierTorchSKTimeWrapper
Python template · sinapsis_sktime.templates.sktime_classifiers
Overview
Template for SkTime classification model training and inference for the deep_learning module.
FCNClassifierTorch — inherited documentation
Fully Convolutional Network (FCN) in PyTorch for time series classification.
Adapted from the TensorFlow FCN implementation in sktime.
Parameters ---------- filter_sizes : tuple of int, default = (128, 256, 128) Number of filters for each convolutional layer. The number of convolutional layers is inferred from the length of this tuple. kernel_sizes : tuple of int, default = (8, 5, 3) Kernel size for each convolutional layer. Must have the same length as ``filter_sizes``. activation_hidden : str or None or an instance of activation functions defined in torch.nn, default = "relu" Activation function applied after each BatchNorm layer in the convolutional blocks. If str, supported values are ``"relu"``, ``"tanh"``, ``"sigmoid"``. If not str, must be an instantiated ``torch.nn.Module`` activation. If ``None``, no activation is applied (identity). activation : str or None or an instance of activation functions defined in torch.nn, default = None Activation function used in the fully connected output layer. init_weights : str or None, default = "kaiming_uniform" The method to initialize the weights of the convolutional layers. Supported values: ``"kaiming_uniform"``, ``"kaiming_normal"``, ``"xavier_uniform"``, ``"xavier_normal"``, or ``None`` for default PyTorch initialization. num_epochs : int, default = 2000 The number of epochs to train the model. batch_size : int, default = 16 The size of each mini-batch during training. optimizer : case insensitive str or None, or a class or instance of optimizers defined in torch.optim, default = "Adam" The optimizer to use for training the model. List of available optimizers: https://pytorch.org/docs/stable/optim.html#algorithms optimizer_kwargs : dict or None, default = None Additional keyword arguments to pass to the optimizer. criterion : case insensitive str or None or an instance of a loss function defined in PyTorch, default = "CrossEntropyLoss" The loss function to be used in training the neural network. List of available loss functions: https://pytorch.org/docs/stable/nn.html#loss-functions criterion_kwargs : dict or None, default = None Additional keyword arguments to pass to the loss function. callbacks : None or str or a tuple of str, default = "ReduceLROnPlateau" Currently only learning rate schedulers are supported as callbacks. If more than one scheduler is passed, they are applied sequentially in the order they are passed. If None, then no learning rate scheduler is used. List of available learning rate schedulers: https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate callback_kwargs : dict or None, default = None The keyword arguments to be passed to the callbacks. lr : float, default = 0.01 The learning rate to use for the optimizer. verbose : bool, default = False Whether to print progress information during training. random_state : int, default = 0 Seed to ensure reproducibility.
Examples -------- >>> from sktime.classification.deep_learning.fcn import FCNClassifierTorch >>> from sktime.datasets import load_unit_test >>> X_train, y_train = load_unit_test(split="train") >>> X_test, y_test = load_unit_test(split="test") >>> clf = FCNClassifierTorch(num_epochs=20, batch_size=4) # doctest: +SKIP >>> clf.fit(X_train, y_train) # doctest: +SKIP FCNClassifierTorch(...)
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-sktime==1.0.0uv pip install sinapsis-sktime==1.0.0uv add sinapsis-sktime==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
Path where the trained model will be saved. fcnclassifiertorch_init filter_sizes <class 'tuple'>: default: (128, 256, 128) kernel_sizes <class 'tuple'>: default: (8, 5, 3) activation_hidden <class 'str'>: default: relu… Read full field description
Path where the trained model will be saved. fcnclassifiertorch_init filter_sizes <class 'tuple'>: default: (128, 256, 128) kernel_sizes <class 'tuple'>: default: (8, 5, 3) activation_hidden <class 'str'>: default: relu activation typing.Union[str, collections.abc.Callable, NoneType]: default: None init_weights typing.Optional[str]: default: kaiming_uniform num_epochs <class 'int'>: default: 2000 batch_size <class 'int'>: default: 16 optimizer typing.Union[str, collections.abc.Callable, NoneType]: default: Adam optimizer_kwargs typing.Optional[dict]: default: None criterion typing.Union[str, collections.abc.Callable, NoneType]: default: CrossEntropyLoss criterion_kwargs typing.Optional[dict]: default: None callbacks typing.Union[NoneType, str, tuple[str, ...]]: default: ReduceLROnPlateau callback_kwargs typing.Optional[dict]: default: None lr <class 'float'>: default: 0.01 verbose <class 'bool'>: default: False random_state <class 'int'>: default: 0
Required
Default: null
Required
Default: null
Optional
Default: 0.01
Optional
Default: false
Optional
Default: "ReduceLROnPlateau"
Optional
Default: "CrossEntropyLoss"
Optional
Default: "Adam"
Optional
Default: null
Optional
Default: 16
Optional
Default: 2000
Optional
Default: [128,256,128]
Optional
Default: "kaiming_uniform"
Optional
Default: [8,5,3]
Optional
Default: 0
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: "relu"
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "FCNClassifierTorchSKTimeWrapper"
class_name: "FCNClassifierTorchSKTimeWrapper"
attributes:
root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
model_save_path: "<required>"
fcnclassifiertorch_init:
lr: 0.01
verbose: false
callbacks: "ReduceLROnPlateau"
criterion: "CrossEntropyLoss"
optimizer: "Adam"
activation: null
batch_size: 16
num_epochs: 2000
filter_sizes: {}
init_weights: "kaiming_uniform"
kernel_sizes: {}
random_state: 0
callback_kwargs: null
criterion_kwargs: null
optimizer_kwargs: null
activation_hidden: "relu"
Inheritance
sinapsis_sktime.templates.sktime_classifiers.SKTimeDeepLearningClassifiersEnvironment variables
Environment definitions belong to their canonical Python modules.