We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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)



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sktime/classification/deep_learning/tapnet.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """Time Convolutional Neural Network (CNN) for classification."""
3 
4 __author__ = [
5     "Jack Russon",
6 ]
7 __all__ = [
8     "TapNetClassifier",
9 ]
10 
11 from sklearn.utils import check_random_state
12 
13 from sktime.classification.deep_learning.base import BaseDeepClassifier
14 from sktime.networks.tapnet import TapNetNetwork
15 from sktime.utils.validation._dependencies import _check_dl_dependencies
16 
17 _check_dl_dependencies(severity="warning")
18 
19 
20 class TapNetClassifier(BaseDeepClassifier):
21     """Implementation of TapNetClassifier, as described in [1].
22 
23     Parameters
24     ----------
25     filter_sizes        : array of int, default = (256, 256, 128)
26         sets the kernel size argument for each convolutional block.
27         Controls number of convolutional filters
28         and number of neurons in attention dense layers.
29     kernel_sizes        : array of int, default = (8, 5, 3)
30         controls the size of the convolutional kernels
31     layers              : array of int, default = (500, 300)
32         size of dense layers
33     reduction           : int, default = 16
34         divides the number of dense neurons in the first layer of the attention block.
35     n_epochs            : int, default = 2000
36         number of epochs to train the model
37     batch_size          : int, default = 16
38         number of samples per update
39     dropout             : float, default = 0.5
40         dropout rate, in the range [0, 1)
41     dilation            : int, default = 1
42         dilation value
43     activation          : str, default = "sigmoid"
44         activation function for the last output layer
45     loss                : str, default = "binary_crossentropy"
46         loss function for the classifier
47     optimizer           : str or None, default = "Adam(lr=0.01)"
48         gradient updating function for the classifer
49     use_bias            : bool, default = True
50         whether to use bias in the output dense layer
51     use_rp              : bool, default = True
52         whether to use random projections
53     use_att             : bool, default = True
54         whether to use self attention
55     use_lstm        : bool, default = True
56         whether to use an LSTM layer
57     use_cnn         : bool, default = True
58         whether to use a CNN layer
59     verbose         : bool, default = False
60         whether to output extra information
61     random_state    : int or None, default = None
62         seed for random
63 
64     Attributes
65     ----------
66     n_classes      : int
67         number of classes extracted from the data
68 
69     References
70     ----------
71     .. [1] Zhang et al. Tapnet: Multivariate time series classification with
72     attentional prototypical network,
73     Proceedings of the AAAI Conference on Artificial Intelligence
74     34(4), 6845-6852, 2020
75 
76     Examples
77     --------
78     >>> from sktime.classification.deep_learning.tapnet import TapNetClassifier
79     >>> from sktime.datasets import load_unit_test
80     >>> X_train, y_train = load_unit_test(split="train", return_X_y=True)
81     >>> X_test, y_test = load_unit_test(split="test", return_X_y=True)
82     >>> tapnet = TapNetClassifier()  # doctest: +SKIP
83     >>> tapnet.fit(X_train, y_train) # doctest: +SKIP
84     TapNetClassifier(...)
85     """
86 
87     _tags = {"python_dependencies": "tensorflow"}
88 
89     def __init__(
90         self,
91         n_epochs=2000,
92         batch_size=16,
93         dropout=0.5,
94         filter_sizes=(256, 256, 128),
95         kernel_size=(8, 5, 3),
96         dilation=1,
97         layers=(500, 300),
98         use_rp=True,
99         rp_params=(-1, 3),
100         activation="sigmoid",
101         use_bias=True,
102         use_att=True,
103         use_lstm=True,
104         use_cnn=True,
105         random_state=None,
106         padding="same",
107         loss="binary_crossentropy",
108         optimizer=None,
109         metrics=None,
110         callbacks=None,
111         verbose=False,
112     ):
113         _check_dl_dependencies(severity="error")
114         super(TapNetClassifier, self).__init__()
115 
116         self.batch_size = batch_size
117         self.random_state = random_state
118         self.kernel_size = kernel_size
119         self.layers = layers
120         self.rp_params = rp_params
121         self.filter_sizes = filter_sizes
122         self.activation = activation
123         self.use_att = use_att
124         self.use_bias = use_bias
125 
126         self.dilation = dilation
127         self.padding = padding
128         self.n_epochs = n_epochs
129         self.loss = loss
130         self.optimizer = optimizer
131         self.metrics = metrics
132         self.callbacks = callbacks
133         self.verbose = verbose
134 
135         self._is_fitted = False
136 
137         self.dropout = dropout
138         self.use_lstm = use_lstm
139         self.use_cnn = use_cnn
140 
141         # parameters for random projection
142         self.use_rp = use_rp
143         self.rp_params = rp_params
144 
145         self._network = TapNetNetwork()
146 
147     def build_model(self, input_shape, n_classes, **kwargs):
148         """Construct a complied, un-trained, keras model that is ready for training.
149 
150         In sktime, time series are stored in numpy arrays of shape (d,m), where d
151         is the number of dimensions, m is the series length. Keras/tensorflow assume
152         data is in shape (m,d). This method also assumes (m,d). Transpose should
153         happen in fit.
154 
155         Parameters
156         ----------
157         input_shape     : tuple
158             The shape of the data fed into the input layer, should be (m, d)
159         n_classes       : int
160             The number of classes, which becomes the size of the output layer
161 
162         Returns
163         -------
164         output: a compiled Keras model
165         """
166         import tensorflow as tf
167         from tensorflow import keras
168 
169         tf.random.set_seed(self.random_state)
170 
171         if self.metrics is None:
172             metrics = ["accuracy"]
173         else:
174             metrics = self.metrics
175 
176         input_layer, output_layer = self._network.build_network(input_shape, **kwargs)
177 
178         output_layer = keras.layers.Dense(
179             units=n_classes, activation=self.activation, use_bias=self.use_bias
180         )(output_layer)
181 
182         self.optimizer_ = (
183             keras.optimizers.Adam(learning_rate=0.01)
184             if self.optimizer is None
185             else self.optimizer
186         )
187 
188         model = keras.models.Model(inputs=input_layer, outputs=output_layer)
189         model.compile(
190             loss=self.loss,
191             optimizer=self.optimizer_,
192             metrics=metrics,
193         )
194 
195         return model
196 
197     def _fit(self, X, y):
198         """Fit the classifier on the training set (X, y).
199 
200         Parameters
201         ----------
202         X   : np.ndarray of shape = (n_instances(n), n_dimensions(d), series_length(m))
203             Input training samples
204         y   : np.ndarray of shape n
205             Input training class labels
206 
207         Returns
208         -------
209         self: object
210         """
211         if self.callbacks is None:
212             self._callbacks = []
213 
214         y_onehot = self.convert_y_to_keras(y)
215         # Transpose to conform to expectation format by keras
216         X = X.transpose(0, 2, 1)
217 
218         check_random_state(self.random_state)
219         self.input_shape = X.shape[1:]
220         self.model_ = self.build_model(self.input_shape, self.n_classes_)
221         if self.verbose:
222             self.model_.summary()
223         self.history = self.model_.fit(
224             X,
225             y_onehot,
226             batch_size=self.batch_size,
227             epochs=self.n_epochs,
228             verbose=self.verbose,
229             callbacks=self._callbacks,
230         )
231 
232         return self
233
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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
@@ -3,6 +3,8 @@
 
 __author__ = [
     "Jack Russon",
+    "TonyBagnall",
+    "achieveordie",
 ]
 __all__ = [
     "TapNetClassifier",
@@ -230,3 +232,33 @@
         )
 
         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`.
+        """
+        return {
+            "n_epochs": 50,
+            "batch_size": 32,
+            "filter_sizes": (128, 128, 64),
+            "dilation": 2,
+            "layers": (200, 100),
+        }

{"golden_diff": "diff --git a/sktime/classification/deep_learning/tapnet.py b/sktime/classification/deep_learning/tapnet.py\n--- a/sktime/classification/deep_learning/tapnet.py\n+++ b/sktime/classification/deep_learning/tapnet.py\n@@ -3,6 +3,8 @@\n \n __author__ = [\n     \"Jack Russon\",\n+    \"TonyBagnall\",\n+    \"achieveordie\",\n ]\n __all__ = [\n     \"TapNetClassifier\",\n@@ -230,3 +232,33 @@\n         )\n \n         return self\n+\n+    @classmethod\n+    def get_test_params(cls, parameter_set=\"default\"):\n+        \"\"\"Return testing parameter settings for the estimator.\n+\n+        Parameters\n+        ----------\n+        parameter_set : str, default=\"default\"\n+            Name of the set of test parameters to return, for use in tests. If no\n+            special parameters are defined for a value, will return `\"default\"` set.\n+            For classifiers, a \"default\" set of parameters should be provided for\n+            general testing, and a \"results_comparison\" set for comparing against\n+            previously recorded results if the general set does not produce suitable\n+            probabilities to compare against.\n+\n+        Returns\n+        -------\n+        params : dict or list of dict, default={}\n+            Parameters to create testing instances of the class.\n+            Each dict are parameters to construct an \"interesting\" test instance, i.e.,\n+            `MyClass(**params)` or `MyClass(**params[i])` creates a valid test instance.\n+            `create_test_instance` uses the first (or only) dictionary in `params`.\n+        \"\"\"\n+        return {\n+            \"n_epochs\": 50,\n+            \"batch_size\": 32,\n+            \"filter_sizes\": (128, 128, 64),\n+            \"dilation\": 2,\n+            \"layers\": (200, 100),\n+        }\n", "issue": "[BUG] TapNet test failures and long test times\nTapNet 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.\r\n\r\nhttps://github.com/sktime/sktime/actions/runs/3174214839/jobs/5170841022\r\n\r\n![image](https://user-images.githubusercontent.com/25731235/193617763-fe72fe51-8338-47c6-947f-0f03173aa204.png)\r\n\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Time Convolutional Neural Network (CNN) for classification.\"\"\"\n\n__author__ = [\n    \"Jack Russon\",\n]\n__all__ = [\n    \"TapNetClassifier\",\n]\n\nfrom sklearn.utils import check_random_state\n\nfrom sktime.classification.deep_learning.base import BaseDeepClassifier\nfrom sktime.networks.tapnet import TapNetNetwork\nfrom sktime.utils.validation._dependencies import _check_dl_dependencies\n\n_check_dl_dependencies(severity=\"warning\")\n\n\nclass TapNetClassifier(BaseDeepClassifier):\n    \"\"\"Implementation of TapNetClassifier, as described in [1].\n\n    Parameters\n    ----------\n    filter_sizes        : array of int, default = (256, 256, 128)\n        sets the kernel size argument for each convolutional block.\n        Controls number of convolutional filters\n        and number of neurons in attention dense layers.\n    kernel_sizes        : array of int, default = (8, 5, 3)\n        controls the size of the convolutional kernels\n    layers              : array of int, default = (500, 300)\n        size of dense layers\n    reduction           : int, default = 16\n        divides the number of dense neurons in the first layer of the attention block.\n    n_epochs            : int, default = 2000\n        number of epochs to train the model\n    batch_size          : int, default = 16\n        number of samples per update\n    dropout             : float, default = 0.5\n        dropout rate, in the range [0, 1)\n    dilation            : int, default = 1\n        dilation value\n    activation          : str, default = \"sigmoid\"\n        activation function for the last output layer\n    loss                : str, default = \"binary_crossentropy\"\n        loss function for the classifier\n    optimizer           : str or None, default = \"Adam(lr=0.01)\"\n        gradient updating function for the classifer\n    use_bias            : bool, default = True\n        whether to use bias in the output dense layer\n    use_rp              : bool, default = True\n        whether to use random projections\n    use_att             : bool, default = True\n        whether to use self attention\n    use_lstm        : bool, default = True\n        whether to use an LSTM layer\n    use_cnn         : bool, default = True\n        whether to use a CNN layer\n    verbose         : bool, default = False\n        whether to output extra information\n    random_state    : int or None, default = None\n        seed for random\n\n    Attributes\n    ----------\n    n_classes      : int\n        number of classes extracted from the data\n\n    References\n    ----------\n    .. [1] Zhang et al. Tapnet: Multivariate time series classification with\n    attentional prototypical network,\n    Proceedings of the AAAI Conference on Artificial Intelligence\n    34(4), 6845-6852, 2020\n\n    Examples\n    --------\n    >>> from sktime.classification.deep_learning.tapnet import TapNetClassifier\n    >>> from sktime.datasets import load_unit_test\n    >>> X_train, y_train = load_unit_test(split=\"train\", return_X_y=True)\n    >>> X_test, y_test = load_unit_test(split=\"test\", return_X_y=True)\n    >>> tapnet = TapNetClassifier()  # doctest: +SKIP\n    >>> tapnet.fit(X_train, y_train) # doctest: +SKIP\n    TapNetClassifier(...)\n    \"\"\"\n\n    _tags = {\"python_dependencies\": \"tensorflow\"}\n\n    def __init__(\n        self,\n        n_epochs=2000,\n        batch_size=16,\n        dropout=0.5,\n        filter_sizes=(256, 256, 128),\n        kernel_size=(8, 5, 3),\n        dilation=1,\n        layers=(500, 300),\n        use_rp=True,\n        rp_params=(-1, 3),\n        activation=\"sigmoid\",\n        use_bias=True,\n        use_att=True,\n        use_lstm=True,\n        use_cnn=True,\n        random_state=None,\n        padding=\"same\",\n        loss=\"binary_crossentropy\",\n        optimizer=None,\n        metrics=None,\n        callbacks=None,\n        verbose=False,\n    ):\n        _check_dl_dependencies(severity=\"error\")\n        super(TapNetClassifier, self).__init__()\n\n        self.batch_size = batch_size\n        self.random_state = random_state\n        self.kernel_size = kernel_size\n        self.layers = layers\n        self.rp_params = rp_params\n        self.filter_sizes = filter_sizes\n        self.activation = activation\n        self.use_att = use_att\n        self.use_bias = use_bias\n\n        self.dilation = dilation\n        self.padding = padding\n        self.n_epochs = n_epochs\n        self.loss = loss\n        self.optimizer = optimizer\n        self.metrics = metrics\n        self.callbacks = callbacks\n        self.verbose = verbose\n\n        self._is_fitted = False\n\n        self.dropout = dropout\n        self.use_lstm = use_lstm\n        self.use_cnn = use_cnn\n\n        # parameters for random projection\n        self.use_rp = use_rp\n        self.rp_params = rp_params\n\n        self._network = TapNetNetwork()\n\n    def build_model(self, input_shape, n_classes, **kwargs):\n        \"\"\"Construct a complied, un-trained, keras model that is ready for training.\n\n        In sktime, time series are stored in numpy arrays of shape (d,m), where d\n        is the number of dimensions, m is the series length. Keras/tensorflow assume\n        data is in shape (m,d). This method also assumes (m,d). Transpose should\n        happen in fit.\n\n        Parameters\n        ----------\n        input_shape     : tuple\n            The shape of the data fed into the input layer, should be (m, d)\n        n_classes       : int\n            The number of classes, which becomes the size of the output layer\n\n        Returns\n        -------\n        output: a compiled Keras model\n        \"\"\"\n        import tensorflow as tf\n        from tensorflow import keras\n\n        tf.random.set_seed(self.random_state)\n\n        if self.metrics is None:\n            metrics = [\"accuracy\"]\n        else:\n            metrics = self.metrics\n\n        input_layer, output_layer = self._network.build_network(input_shape, **kwargs)\n\n        output_layer = keras.layers.Dense(\n            units=n_classes, activation=self.activation, use_bias=self.use_bias\n        )(output_layer)\n\n        self.optimizer_ = (\n            keras.optimizers.Adam(learning_rate=0.01)\n            if self.optimizer is None\n            else self.optimizer\n        )\n\n        model = keras.models.Model(inputs=input_layer, outputs=output_layer)\n        model.compile(\n            loss=self.loss,\n            optimizer=self.optimizer_,\n            metrics=metrics,\n        )\n\n        return model\n\n    def _fit(self, X, y):\n        \"\"\"Fit the classifier on the training set (X, y).\n\n        Parameters\n        ----------\n        X   : np.ndarray of shape = (n_instances(n), n_dimensions(d), series_length(m))\n            Input training samples\n        y   : np.ndarray of shape n\n            Input training class labels\n\n        Returns\n        -------\n        self: object\n        \"\"\"\n        if self.callbacks is None:\n            self._callbacks = []\n\n        y_onehot = self.convert_y_to_keras(y)\n        # Transpose to conform to expectation format by keras\n        X = X.transpose(0, 2, 1)\n\n        check_random_state(self.random_state)\n        self.input_shape = X.shape[1:]\n        self.model_ = self.build_model(self.input_shape, self.n_classes_)\n        if self.verbose:\n            self.model_.summary()\n        self.history = self.model_.fit(\n            X,\n            y_onehot,\n            batch_size=self.batch_size,\n            epochs=self.n_epochs,\n            verbose=self.verbose,\n            callbacks=self._callbacks,\n        )\n\n        return self\n", "path": "sktime/classification/deep_learning/tapnet.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Time Convolutional Neural Network (CNN) for classification.\"\"\"\n\n__author__ = [\n    \"Jack Russon\",\n    \"TonyBagnall\",\n    \"achieveordie\",\n]\n__all__ = [\n    \"TapNetClassifier\",\n]\n\nfrom sklearn.utils import check_random_state\n\nfrom sktime.classification.deep_learning.base import BaseDeepClassifier\nfrom sktime.networks.tapnet import TapNetNetwork\nfrom sktime.utils.validation._dependencies import _check_dl_dependencies\n\n_check_dl_dependencies(severity=\"warning\")\n\n\nclass TapNetClassifier(BaseDeepClassifier):\n    \"\"\"Implementation of TapNetClassifier, as described in [1].\n\n    Parameters\n    ----------\n    filter_sizes        : array of int, default = (256, 256, 128)\n        sets the kernel size argument for each convolutional block.\n        Controls number of convolutional filters\n        and number of neurons in attention dense layers.\n    kernel_sizes        : array of int, default = (8, 5, 3)\n        controls the size of the convolutional kernels\n    layers              : array of int, default = (500, 300)\n        size of dense layers\n    reduction           : int, default = 16\n        divides the number of dense neurons in the first layer of the attention block.\n    n_epochs            : int, default = 2000\n        number of epochs to train the model\n    batch_size          : int, default = 16\n        number of samples per update\n    dropout             : float, default = 0.5\n        dropout rate, in the range [0, 1)\n    dilation            : int, default = 1\n        dilation value\n    activation          : str, default = \"sigmoid\"\n        activation function for the last output layer\n    loss                : str, default = \"binary_crossentropy\"\n        loss function for the classifier\n    optimizer           : str or None, default = \"Adam(lr=0.01)\"\n        gradient updating function for the classifer\n    use_bias            : bool, default = True\n        whether to use bias in the output dense layer\n    use_rp              : bool, default = True\n        whether to use random projections\n    use_att             : bool, default = True\n        whether to use self attention\n    use_lstm        : bool, default = True\n        whether to use an LSTM layer\n    use_cnn         : bool, default = True\n        whether to use a CNN layer\n    verbose         : bool, default = False\n        whether to output extra information\n    random_state    : int or None, default = None\n        seed for random\n\n    Attributes\n    ----------\n    n_classes      : int\n        number of classes extracted from the data\n\n    References\n    ----------\n    .. [1] Zhang et al. Tapnet: Multivariate time series classification with\n    attentional prototypical network,\n    Proceedings of the AAAI Conference on Artificial Intelligence\n    34(4), 6845-6852, 2020\n\n    Examples\n    --------\n    >>> from sktime.classification.deep_learning.tapnet import TapNetClassifier\n    >>> from sktime.datasets import load_unit_test\n    >>> X_train, y_train = load_unit_test(split=\"train\", return_X_y=True)\n    >>> X_test, y_test = load_unit_test(split=\"test\", return_X_y=True)\n    >>> tapnet = TapNetClassifier()  # doctest: +SKIP\n    >>> tapnet.fit(X_train, y_train) # doctest: +SKIP\n    TapNetClassifier(...)\n    \"\"\"\n\n    _tags = {\"python_dependencies\": \"tensorflow\"}\n\n    def __init__(\n        self,\n        n_epochs=2000,\n        batch_size=16,\n        dropout=0.5,\n        filter_sizes=(256, 256, 128),\n        kernel_size=(8, 5, 3),\n        dilation=1,\n        layers=(500, 300),\n        use_rp=True,\n        rp_params=(-1, 3),\n        activation=\"sigmoid\",\n        use_bias=True,\n        use_att=True,\n        use_lstm=True,\n        use_cnn=True,\n        random_state=None,\n        padding=\"same\",\n        loss=\"binary_crossentropy\",\n        optimizer=None,\n        metrics=None,\n        callbacks=None,\n        verbose=False,\n    ):\n        _check_dl_dependencies(severity=\"error\")\n        super(TapNetClassifier, self).__init__()\n\n        self.batch_size = batch_size\n        self.random_state = random_state\n        self.kernel_size = kernel_size\n        self.layers = layers\n        self.rp_params = rp_params\n        self.filter_sizes = filter_sizes\n        self.activation = activation\n        self.use_att = use_att\n        self.use_bias = use_bias\n\n        self.dilation = dilation\n        self.padding = padding\n        self.n_epochs = n_epochs\n        self.loss = loss\n        self.optimizer = optimizer\n        self.metrics = metrics\n        self.callbacks = callbacks\n        self.verbose = verbose\n\n        self._is_fitted = False\n\n        self.dropout = dropout\n        self.use_lstm = use_lstm\n        self.use_cnn = use_cnn\n\n        # parameters for random projection\n        self.use_rp = use_rp\n        self.rp_params = rp_params\n\n        self._network = TapNetNetwork()\n\n    def build_model(self, input_shape, n_classes, **kwargs):\n        \"\"\"Construct a complied, un-trained, keras model that is ready for training.\n\n        In sktime, time series are stored in numpy arrays of shape (d,m), where d\n        is the number of dimensions, m is the series length. Keras/tensorflow assume\n        data is in shape (m,d). This method also assumes (m,d). Transpose should\n        happen in fit.\n\n        Parameters\n        ----------\n        input_shape     : tuple\n            The shape of the data fed into the input layer, should be (m, d)\n        n_classes       : int\n            The number of classes, which becomes the size of the output layer\n\n        Returns\n        -------\n        output: a compiled Keras model\n        \"\"\"\n        import tensorflow as tf\n        from tensorflow import keras\n\n        tf.random.set_seed(self.random_state)\n\n        if self.metrics is None:\n            metrics = [\"accuracy\"]\n        else:\n            metrics = self.metrics\n\n        input_layer, output_layer = self._network.build_network(input_shape, **kwargs)\n\n        output_layer = keras.layers.Dense(\n            units=n_classes, activation=self.activation, use_bias=self.use_bias\n        )(output_layer)\n\n        self.optimizer_ = (\n            keras.optimizers.Adam(learning_rate=0.01)\n            if self.optimizer is None\n            else self.optimizer\n        )\n\n        model = keras.models.Model(inputs=input_layer, outputs=output_layer)\n        model.compile(\n            loss=self.loss,\n            optimizer=self.optimizer_,\n            metrics=metrics,\n        )\n\n        return model\n\n    def _fit(self, X, y):\n        \"\"\"Fit the classifier on the training set (X, y).\n\n        Parameters\n        ----------\n        X   : np.ndarray of shape = (n_instances(n), n_dimensions(d), series_length(m))\n            Input training samples\n        y   : np.ndarray of shape n\n            Input training class labels\n\n        Returns\n        -------\n        self: object\n        \"\"\"\n        if self.callbacks is None:\n            self._callbacks = []\n\n        y_onehot = self.convert_y_to_keras(y)\n        # Transpose to conform to expectation format by keras\n        X = X.transpose(0, 2, 1)\n\n        check_random_state(self.random_state)\n        self.input_shape = X.shape[1:]\n        self.model_ = self.build_model(self.input_shape, self.n_classes_)\n        if self.verbose:\n            self.model_.summary()\n        self.history = self.model_.fit(\n            X,\n            y_onehot,\n            batch_size=self.batch_size,\n            epochs=self.n_epochs,\n            verbose=self.verbose,\n            callbacks=self._callbacks,\n        )\n\n        return self\n\n    @classmethod\n    def get_test_params(cls, parameter_set=\"default\"):\n        \"\"\"Return testing parameter settings for the estimator.\n\n        Parameters\n        ----------\n        parameter_set : str, default=\"default\"\n            Name of the set of test parameters to return, for use in tests. If no\n            special parameters are defined for a value, will return `\"default\"` set.\n            For classifiers, a \"default\" set of parameters should be provided for\n            general testing, and a \"results_comparison\" set for comparing against\n            previously recorded results if the general set does not produce suitable\n            probabilities to compare against.\n\n        Returns\n        -------\n        params : dict or list of dict, default={}\n            Parameters to create testing instances of the class.\n            Each dict are parameters to construct an \"interesting\" test instance, i.e.,\n            `MyClass(**params)` or `MyClass(**params[i])` creates a valid test instance.\n            `create_test_instance` uses the first (or only) dictionary in `params`.\n        \"\"\"\n        return {\n            \"n_epochs\": 50,\n            \"batch_size\": 32,\n            \"filter_sizes\": (128, 128, 64),\n            \"dilation\": 2,\n            \"layers\": (200, 100),\n        }\n", "path": "sktime/classification/deep_learning/tapnet.py"}]}