diff --git a/mlair/model_modules/advanced_paddings.py b/mlair/model_modules/advanced_paddings.py index f2fd4de91e84b1407f54c5ea156ad34f2d46acff..3e64fa9a8c34d2307cc9cced1dfdddcd646520cd 100644 --- a/mlair/model_modules/advanced_paddings.py +++ b/mlair/model_modules/advanced_paddings.py @@ -20,7 +20,7 @@ class PadUtils: """Helper class for advanced padding.""" @staticmethod - def get_padding_for_same(kernel_size: Tuple[int], strides: int = 1) -> Tuple[int]: + def get_padding_for_same(kernel_size: Tuple[int, int], strides: int = 1) -> Tuple[int]: """ Calculate padding size to keep input and output dimensions equal for a given kernel size. diff --git a/mlair/model_modules/model_class.py b/mlair/model_modules/model_class.py index 7e0895fbb81cdab3e6c83956d8e74ebb6979384f..783148086a413aaaf8bfeb33b13d8da5c72f1df5 100644 --- a/mlair/model_modules/model_class.py +++ b/mlair/model_modules/model_class.py @@ -476,9 +476,9 @@ class MyLSTMModel(AbstractModelClass): super().__init__(input_shape[0], output_shape[0]) # settings - self.dropout_rate = 0.4 + self.dropout_rate = 0.1 self.stateful = False - self.initial_lr = 1e-5 + self.initial_lr = 1e-4 # apply to model self.set_model() @@ -487,9 +487,9 @@ class MyLSTMModel(AbstractModelClass): def set_model(self): x_input = keras.layers.Input(shape=self._input_shape) - x_in = keras.layers.LSTM(16, return_sequences=True, name="First_LSTM", dropout=self.dropout_rate, stateful=self.stateful)(x_input) - x_in = keras.layers.Dropout(self.dropout_rate)(x_in) - x_in = keras.layers.LSTM(16, name="Second_LSTM", dropout=self.dropout_rate, stateful=self.stateful)(x_in) + x_in = keras.layers.LSTM(16*2*2*2, return_sequences=True, name="First_LSTM", dropout=self.dropout_rate, stateful=self.stateful)(x_input) + # x_in = keras.layers.Dropout(self.dropout_rate)(x_in) + x_in = keras.layers.LSTM(16*2*2*2, name="Second_LSTM", dropout=self.dropout_rate, stateful=self.stateful)(x_in) out_main = keras.layers.Dense(self._output_shape, name='Output_Dense')(x_in) self.model = keras.Model(inputs=x_input, outputs=[out_main]) @@ -612,7 +612,7 @@ class MyCNNModelSect(AbstractModelClass): first_filters = 16 pad_size1 = PadUtils.get_padding_for_same(first_kernel) - pool_kernel = (3,1) + pool_kernel = (3, 1) pad_size_pool = PadUtils.get_padding_for_same(pool_kernel) second_kernel = (3, 1)