Skip to content

Commit fca5035

Browse files
[ENH] Starting Self Supervised Model with first example (#2385)
* add ssl module in transformations collection * add api * add test params * fix example * restart tests * test fix params * network none * revert * import inside function * try dummy * test repr * network repr * enhance testing * fix test * replace tcnn by lite * tony's comments * fix typing * fix znorm * z_norm in test * add exp module * Update repr.py * Update base.py * Automatic `pre-commit` fixes --------- Co-authored-by: MatthewMiddlehurst <pfm15hbu@gmail.com> Co-authored-by: MatthewMiddlehurst <25731235+MatthewMiddlehurst@users.noreply.github.com>
1 parent 5a1b5db commit fca5035

File tree

12 files changed

+1043
-1
lines changed

12 files changed

+1043
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ does not apply:
2626
- `segmentation`
2727
- `similarity_search`
2828
- `visualisation`
29+
- `transformations.collection.self_supervised`
2930

3031
| Overview | |
3132
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

aeon/networks/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from abc import ABC, abstractmethod
66

7+
from aeon.utils.repr import get_unchanged_and_required_params_as_str
78
from aeon.utils.validation._dependencies import (
89
_check_python_version,
910
_check_soft_dependencies,
@@ -25,6 +26,11 @@ def __init__(self, soft_dependencies="tensorflow", python_version="<3.13"):
2526
_check_python_version(python_version)
2627
super().__init__()
2728

29+
def __repr__(self):
30+
"""Format str output like scikit-learn estimators."""
31+
changed_params = get_unchanged_and_required_params_as_str(self)
32+
return f"{self.__class__.__name__}({changed_params})"
33+
2834
@abstractmethod
2935
def build_network(self, input_shape, **kwargs):
3036
"""Construct a network and return its input and output layers.

aeon/networks/tests/test_network_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def build_network(self, input_shape, **kwargs):
2020
import tensorflow as tf
2121

2222
input_layer = tf.keras.layers.Input(input_shape)
23-
output_layer = tf.keras.layers.Dense(units=10)(input_layer)
23+
flatten_layer = tf.keras.layers.Flatten()(input_layer)
24+
output_layer = tf.keras.layers.Dense(units=10)(flatten_layer)
2425

2526
return input_layer, output_layer
2627

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Self Supervised deep learning transformers."""
2+
3+
__all__ = ["TRILITE"]
4+
5+
from aeon.transformations.collection.self_supervised._trilite import TRILITE

0 commit comments

Comments
 (0)