Repository: sktime/sktime

Issue:
[BUG] TapNet test failures and long test times
TapNet is currently failing the macOS 3.7 test (`Install and test / test-unix (3.7, macOS-11) (pull_request)`) in PR #3523. The PR makes no changes relevant to TapNet or DL estimators, and the test times are extremely high.

https://github.com/sktime/sktime/actions/runs/3174214839/jobs/5170841022

![image](https://user-images.githubusercontent.com/25731235/193617763-fe72fe51-8338-47c6-947f-0f03173aa204.png)




Discussion:
FYI @achieveordie, you added these recently, no?
https://github.com/sktime/sktime/pull/3386
can verify this on another branch. The classifier needs a get_test_params method with a faster configuration

@classmethod
    def get_test_params(cls, parameter_set="default"):
        """Return testing parameter settings for the estimator.


Resolving patch:
diff --git a/sktime/classification/deep_learning/tapnet.py b/sktime/classification/deep_learning/tapnet.py
--- a/sktime/classification/deep_learning/tapnet.py
+++ b/sktime/classification/deep_learning/tapnet.py
@@ -134,8 +134,6 @@ def __init__(
         self.callbacks = callbacks
         self.verbose = verbose
 
-        self._is_fitted = False
-
         self.dropout = dropout
         self.use_lstm = use_lstm
         self.use_cnn = use_cnn
@@ -255,10 +253,20 @@ def get_test_params(cls, parameter_set="default"):
             `MyClass(**params)` or `MyClass(**params[i])` creates a valid test instance.
             `create_test_instance` uses the first (or only) dictionary in `params`.
         """
-        return {
+        param1 = {
             "n_epochs": 50,
             "batch_size": 32,
+            "use_lstm": False,
+            "use_att": False,
             "filter_sizes": (128, 128, 64),
             "dilation": 2,
-            "layers": (200, 100),
+            "layers": (50, 25),
+        }
+
+        param2 = {
+            "n_epochs": 100,
+            "use_cnn": False,
+            "layers": (25, 25),
         }
+
+        return [param1, param2]
diff --git a/sktime/regression/deep_learning/tapnet.py b/sktime/regression/deep_learning/tapnet.py
--- a/sktime/regression/deep_learning/tapnet.py
+++ b/sktime/regression/deep_learning/tapnet.py
@@ -38,10 +38,10 @@ class TapNetRegressor(BaseDeepRegressor):
         dilation value
     activation          : str, default = "sigmoid"
         activation function for the last output layer
-    loss                : str, default = "binary_crossentropy"
+    loss                : str, default = "mean_squared_error"
         loss function for the classifier
     optimizer           : str or None, default = "Adam(lr=0.01)"
-        gradient updating function for the classifer
+        gradient updating function for the classifier
     use_bias            : bool, default = True
         whether to use bias in the output dense layer
     use_rp              : bool, default = True
@@ -119,8 +119,6 @@ def __init__(
         self.callbacks = callbacks
         self.verbose = verbose
 
-        self._is_fitted = False
-
         self.dropout = dropout
         self.use_lstm = use_lstm
         self.use_cnn = use_cnn
@@ -213,3 +211,42 @@ def _fit(self, X, y):
         )
 
         return self
+
+    @classmethod
+    def get_test_params(cls, parameter_set="default"):
+        """Return testing parameter settings for the estimator.
+
+        Parameters
+        ----------
+        parameter_set : str, default="default"
+            Name of the set of test parameters to return, for use in tests. If no
+            special parameters are defined for a value, will return `"default"` set.
+            For classifiers, a "default" set of parameters should be provided for
+            general testing, and a "results_comparison" set for comparing against
+            previously recorded results if the general set does not produce suitable
+            probabilities to compare against.
+
+        Returns
+        -------
+        params : dict or list of dict, default={}
+            Parameters to create testing instances of the class.
+            Each dict are parameters to construct an "interesting" test instance, i.e.,
+            `MyClass(**params)` or `MyClass(**params[i])` creates a valid test instance.
+            `create_test_instance` uses the first (or only) dictionary in `params`.
+        """
+        param1 = {
+            "n_epochs": 25,
+            "batch_size": 32,
+            "padding": "valid",
+            "filter_sizes": (64, 64, 64),
+            "kernel_size": (3, 3, 1),
+            "layers": (25, 50),
+        }
+
+        param2 = {
+            "n_epochs": 75,
+            "use_rp": False,
+            "layers": (50, 25),
+        }
+
+        return [param1, param2]


Test patch: