From ed7abb01c55325e9be994b232998fb17e480beca Mon Sep 17 00:00:00 2001 From: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com> Date: Mon, 15 Jul 2024 08:38:01 +0000 Subject: [PATCH] style: apply automated linter fixes --- src/safeds/ml/nn/layers/_forward_layer.py | 21 +++++++++++++------ .../safeds/ml/nn/layers/test_forward_layer.py | 1 - 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/safeds/ml/nn/layers/_forward_layer.py b/src/safeds/ml/nn/layers/_forward_layer.py index 13f44ffd8..c41146834 100644 --- a/src/safeds/ml/nn/layers/_forward_layer.py +++ b/src/safeds/ml/nn/layers/_forward_layer.py @@ -32,8 +32,11 @@ class ForwardLayer(Layer): If the given activation function does not exist """ - def __init__(self, neuron_count: int, - overwrite_activation_function: Literal["sigmoid", "relu", "softmax", "none", "notset"] = "notset"): + def __init__( + self, + neuron_count: int, + overwrite_activation_function: Literal["sigmoid", "relu", "softmax", "none", "notset"] = "notset", + ): _check_bounds("neuron_count", neuron_count, lower_bound=_ClosedBound(1)) self._input_size: int | None = None @@ -98,11 +101,17 @@ def __eq__(self, other: object) -> bool: return NotImplemented if self is other: return True - return (self._input_size == other._input_size and self._output_size == other._output_size - and self._activation_function == other._activation_function) + return ( + self._input_size == other._input_size + and self._output_size == other._output_size + and self._activation_function == other._activation_function + ) def __sizeof__(self) -> int: import sys - return (sys.getsizeof(self._input_size) + sys.getsizeof(self._output_size) - + sys.getsizeof(self._activation_function)) + return ( + sys.getsizeof(self._input_size) + + sys.getsizeof(self._output_size) + + sys.getsizeof(self._activation_function) + ) diff --git a/tests/safeds/ml/nn/layers/test_forward_layer.py b/tests/safeds/ml/nn/layers/test_forward_layer.py index 733388c3b..a2bcddcb3 100644 --- a/tests/safeds/ml/nn/layers/test_forward_layer.py +++ b/tests/safeds/ml/nn/layers/test_forward_layer.py @@ -7,7 +7,6 @@ from safeds.ml.nn.layers import ForwardLayer from torch import nn - # TODO: Should be tested on a model, not a layer, since input size gets inferred # @pytest.mark.parametrize( # "input_size",