Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/actions/cpu_all_extras/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
using: "composite"
steps:
- name: Install CPU TensorFlow
if: ${{ runner.os == 'Linux' && inputs.python_version != '3.13' && inputs.python_version != '3.14' }}
if: ${{ runner.os == 'Linux' && inputs.python_version != '3.14' }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ jobs:
run: python -m pip list

- name: Run tests
run: python -m pytest -n logical --doctest-only --doctest-continue-on-failure
run: python -m pytest -n logical --doctest-only

- name: Save new cache
uses: actions/cache/save@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
run: python -m pip list

- name: Run tests
run: python -m pytest -n logical --doctest-only --doctest-continue-on-failure
run: python -m pytest -n logical --doctest-only

multithreaded-estimators:
runs-on: ubuntu-24.04
Expand Down
4 changes: 2 additions & 2 deletions aeon/clustering/deep_learning/_ae_drnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from aeon.utils.validation._dependencies import _check_soft_dependencies

if _check_soft_dependencies(["tensorflow"], severity="none"):
from aeon.networks._ae_drnn import _TensorDilation
from aeon.networks.auto_encoder._ae_drnn import _TensorDilation


class AEDRNNClusterer(BaseDeepClusterer):
Expand Down Expand Up @@ -352,7 +352,7 @@ def load_model(self, model_path, estimator):
"""
import tensorflow as tf

from aeon.networks._ae_drnn import _TensorDilation
from aeon.networks.auto_encoder._ae_drnn import _TensorDilation

self.model_ = tf.keras.models.load_model(
model_path, custom_objects={"_TensorDilation": _TensorDilation}
Expand Down
2 changes: 1 addition & 1 deletion aeon/forecasting/deep_learning/_deepar.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from aeon.forecasting.base import DirectForecastingMixin, IterativeForecastingMixin
from aeon.forecasting.deep_learning.base import BaseDeepForecaster
from aeon.networks._deepar import DeepARNetwork
from aeon.networks.encoder_decoder._deepar import DeepARNetwork


class DeepARForecaster(
Expand Down
2 changes: 1 addition & 1 deletion aeon/forecasting/deep_learning/_tcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from aeon.forecasting.base import IterativeForecastingMixin
from aeon.forecasting.deep_learning.base import BaseDeepForecaster
from aeon.networks._tcn import TCNNetwork
from aeon.networks.encoder._tcn import TCNNetwork


class TCNForecaster(BaseDeepForecaster, IterativeForecastingMixin):
Expand Down
39 changes: 20 additions & 19 deletions aeon/networks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
"TCNNetwork",
"NBeatsNetwork",
]
from aeon.networks._ae_abgru import AEAttentionBiGRUNetwork
from aeon.networks._ae_bgru import AEBiGRUNetwork
from aeon.networks._ae_dcnn import AEDCNNNetwork
from aeon.networks._ae_drnn import AEDRNNNetwork
from aeon.networks._ae_fcn import AEFCNNetwork
from aeon.networks._ae_resnet import AEResNetNetwork
from aeon.networks._cnn import TimeCNNNetwork
from aeon.networks._dcnn import DCNNNetwork
from aeon.networks._deepar import DeepARNetwork
from aeon.networks._disjoint_cnn import DisjointCNNNetwork
from aeon.networks._encoder import EncoderNetwork
from aeon.networks._fcn import FCNNetwork
from aeon.networks._inception import InceptionNetwork
from aeon.networks._lite import LITENetwork
from aeon.networks._mlp import MLPNetwork
from aeon.networks._nbeats import NBeatsNetwork
from aeon.networks._resnet import ResNetNetwork
from aeon.networks._rnn import RecurrentNetwork
from aeon.networks._tcn import TCNNetwork

from aeon.networks.auto_encoder._ae_abgru import AEAttentionBiGRUNetwork
from aeon.networks.auto_encoder._ae_bgru import AEBiGRUNetwork
from aeon.networks.auto_encoder._ae_dcnn import AEDCNNNetwork
from aeon.networks.auto_encoder._ae_drnn import AEDRNNNetwork
from aeon.networks.auto_encoder._ae_fcn import AEFCNNetwork
from aeon.networks.auto_encoder._ae_resnet import AEResNetNetwork
from aeon.networks.auto_encoder._nbeats import NBeatsNetwork
from aeon.networks.base import BaseDeepLearningNetwork
from aeon.networks.encoder._cnn import TimeCNNNetwork
from aeon.networks.encoder._dcnn import DCNNNetwork
from aeon.networks.encoder._disjoint_cnn import DisjointCNNNetwork
from aeon.networks.encoder._encoder import EncoderNetwork
from aeon.networks.encoder._fcn import FCNNetwork
from aeon.networks.encoder._inception import InceptionNetwork
from aeon.networks.encoder._lite import LITENetwork
from aeon.networks.encoder._mlp import MLPNetwork
from aeon.networks.encoder._resnet import ResNetNetwork
from aeon.networks.encoder._rnn import RecurrentNetwork
from aeon.networks.encoder._tcn import TCNNetwork
from aeon.networks.encoder_decoder._deepar import DeepARNetwork
1 change: 1 addition & 0 deletions aeon/networks/auto_encoder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Auto-Encoder networks."""
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class AEAttentionBiGRUNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand All @@ -52,15 +51,15 @@ def __init__(
activation_encoder="relu",
activation_decoder="relu",
):
super().__init__()

self.latent_space_dim = latent_space_dim
self.temporal_latent_space = temporal_latent_space
self.activation_encoder = activation_encoder
self.activation_decoder = activation_decoder
self.n_layers_encoder = n_layers_encoder
self.n_layers_decoder = n_layers_decoder

super().__init__()

def build_network(self, input_shape, **kwargs):
"""Construct a network and return its input and output layers.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class AEBiGRUNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class AEDCNNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ class AEDRNNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ class AEFCNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class AEResNetNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class NBeatsNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "auto-encoder",
}

Expand Down
1 change: 1 addition & 0 deletions aeon/networks/auto_encoder/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for Auto-Encoder networks."""
13 changes: 6 additions & 7 deletions aeon/networks/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Abstract base class for deep learning networks."""

__maintainer__ = []
__maintainer__ = ["hadifawaz1999"]

from abc import ABC, abstractmethod

Expand All @@ -15,15 +15,14 @@ class BaseDeepLearningNetwork(ABC):
"""Abstract base class for deep learning networks."""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
"structure": "encoder",
"python_dependencies": "tensorflow",
"python_version": "<3.14",
}

@abstractmethod
def __init__(self, soft_dependencies="tensorflow", python_version="<3.13"):
_check_soft_dependencies(soft_dependencies)
_check_python_version(python_version)
def __init__(self):
_check_soft_dependencies(self._config["python_dependencies"])
_check_python_version(self._config["python_version"])
super().__init__()

def __repr__(self):
Expand Down
1 change: 1 addition & 0 deletions aeon/networks/encoder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Encoder networks."""
3 changes: 1 addition & 2 deletions aeon/networks/_cnn.py → aeon/networks/encoder/_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class TimeCNNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down
9 changes: 4 additions & 5 deletions aeon/networks/_dcnn.py → aeon/networks/encoder/_dcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class DCNNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.12",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand All @@ -56,8 +55,6 @@ def __init__(
dilation_rate=None,
padding="causal",
):
super().__init__()

self.latent_space_dim = latent_space_dim
self.kernel_size = kernel_size
self.n_filters = n_filters
Expand All @@ -66,7 +63,9 @@ def __init__(
self.activation = activation
self.padding = padding

def build_network(self, input_shape):
super().__init__()

def build_network(self, input_shape, **kwargs):
"""Construct a network and return its input and output layers.

Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class DisjointCNNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class EncoderNetwork(BaseDeepLearningNetwork):
for Artificial Intelligence, 120--129 2018.
"""

_config = {
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

def __init__(
self,
kernel_size=None,
Expand Down
3 changes: 1 addition & 2 deletions aeon/networks/_fcn.py → aeon/networks/encoder/_fcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class FCNNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

__maintainer__ = ["hadifawaz1999"]

import numpy as np

from aeon.networks.base import BaseDeepLearningNetwork


Expand Down Expand Up @@ -95,8 +97,7 @@ class InceptionNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down Expand Up @@ -152,23 +153,11 @@ def hybrid_layer(self, input_tensor, input_channels, kernel_sizes=None):
of the output features extracted form hand-crafted convolution filters.

"""
import numpy as np
import tensorflow as tf

kernel_sizes = [2, 4, 8, 16, 32, 64] if kernel_sizes is None else kernel_sizes

self.keep_track = 0

"""
Function to create the hybrid layer consisting of non
trainable Conv1D layers with custom filters.

Args:

input_tensor: input tensor
input_channels : number of input channels, 1 in case of UCR Archive
"""

kernel_sizes = [2, 4, 8, 16, 32, 64] if kernel_sizes is None else kernel_sizes
conv_list = []

# for increasing detection filters
Expand Down
3 changes: 1 addition & 2 deletions aeon/networks/_lite.py → aeon/networks/encoder/_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class LITENetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down
7 changes: 3 additions & 4 deletions aeon/networks/_mlp.py → aeon/networks/encoder/_mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class MLPNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand All @@ -56,15 +55,15 @@ def __init__(
dropout_last: float = None,
use_bias: bool = True,
):
super().__init__()

self.n_layers = n_layers
self.n_units = n_units
self.activation = activation
self.dropout_rate = dropout_rate
self.dropout_last = dropout_last
self.use_bias = use_bias

super().__init__()

def build_network(self, input_shape, **kwargs):
"""Construct a network and return its input and output layers.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ class ResNetNetwork(BaseDeepLearningNetwork):
"""

_config = {
"python_dependencies": ["tensorflow"],
"python_version": "<3.13",
**BaseDeepLearningNetwork._config,
"structure": "encoder",
}

Expand Down
Loading
Loading