Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions data_aug_4_tsc/feature_extractors/_lite.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
"""The LITE classification model."""

import numpy as np
import tensorflow as tf
from aeon.classification.deep_learning import IndividualLITEClassifier


class LITE_CLASSIFIER:
"""The Light Inception with boosTing tEchniques (LITE).

The LITE [1]_ classificaiton model uses a CNN backbone with
an optimized number of parameters to classify time series
samples. We use aeon-toolkit [2]_ 's implementation.

Parameters
----------
output_directory : str
The output directory.
n_epochs : int, default = 1500
The number of epochs to train the model.
batch_size : int, default = 64
The batch size during training.

Returns
-------
None

References
----------
.. [1] Ismail-Fawaz, Ali, Maxime Devanne, Stefano Berretti,
Jonathan Weber, and Germain Forestier. "Lite: Light inception
with boosting techniques for time series classification." In
2023 IEEE 10th International Conference on Data Science and
Advanced Analytics (DSAA), pp. 1-10. IEEE, 2023.

.. [2] Middlehurst, Matthew, Ali Ismail-Fawaz, Antoine Guillaume,
Christopher Holder, David Guijo-Rubio, Guzal Bulatova, Leonidas
Tsaprounis et al. "aeon: a Python toolkit for learning from
time series." Journal of Machine Learning Research 25, no.
289 (2024): 1-10.
"""

def __init__(
self, output_directory: str, n_epochs: int = 1500, batch_size: int = 64
Expand All @@ -15,7 +50,20 @@ def __init__(
self.feature_extractor = None

def fit(self, X: np.ndarray, y: np.ndarray):
"""Train the model on labeled real samples.

Parameters
----------
X : np.ndarray
The real samples.
y : np.ndarray
The labels of the real samples.

Returns
-------
A trained keras model.

"""
self.feature_extractor = IndividualLITEClassifier(
file_path=self.output_directory,
save_best_model=True,
Expand Down
31 changes: 31 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM tensorflow/tensorflow:2.16.1-gpu

ARG USER_ID
ARG GROUP_ID

RUN groupadd -r -g $GROUP_ID myuser && useradd -r -u $USER_ID -g myuser -m -d /home/myuser myuser
ENV SHELL /bin/bash

RUN mkdir -p /home/myuser/code && chown -R myuser:myuser /home/myuser/code

WORKDIR /home/myuser/code

RUN apt update
RUN apt install -y jq

RUN pip install aeon==1.0.0
RUN pip install keras==3.6.0
RUN pip install hydra-core==1.3.2
RUN pip install omegaconf==2.3.0
RUN pip install pandas==2.2.0
RUN pip install matplotlib==3.10.0
RUN pip install numba==0.60.0
RUN pip install black
RUN pip install flake8
RUN pip install mypy
RUN pip install pytest
RUN pip install pytest-cov
RUN pip install pytest-xdist
RUN pip install pytest-timeout
RUN pip install pytest-rerunfailures
RUN pip install pre-commit
Loading