(self)
| 10 | self.input_shape = input_shape |
| 11 | |
| 12 | def make_model(self): |
| 13 | input_data = kl.Input(shape=(1, self.input_shape)) |
| 14 | lstm = kl.LSTM(5, input_shape=(1, self.input_shape), return_sequences=True, activity_regularizer=regularizers.l2(0.003), |
| 15 | recurrent_regularizer=regularizers.l2(0), dropout=0.2, recurrent_dropout=0.2)(input_data) |
| 16 | perc = kl.Dense(5, activation="sigmoid", activity_regularizer=regularizers.l2(0.005))(lstm) |
| 17 | lstm2 = kl.LSTM(2, activity_regularizer=regularizers.l2(0.01), recurrent_regularizer=regularizers.l2(0.001), |
| 18 | dropout=0.2, recurrent_dropout=0.2)(perc) |
| 19 | out = kl.Dense(1, activation="sigmoid", activity_regularizer=regularizers.l2(0.001))(lstm2) |
| 20 | |
| 21 | model = Model(input_data, out) |
| 22 | |
| 23 | self.model = model |
| 24 | |
| 25 | def train_model(self, x, y, epochs, model_name, save_model=True): |
| 26 | self.model.compile(optimizer="adam", loss="mean_squared_error", metrics=["mse", "acc"]) |
no outgoing calls
no test coverage detected