Commit fdb797ce authored by Antonin Dvorak's avatar Antonin Dvorak
Browse files

fix earlystop call

parent 9ce1fe56
......@@ -11,6 +11,7 @@ from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
from tensorflow.keras.regularizers import l2
from tensorflow.keras.callbacks import EarlyStopping
from sklearn.preprocessing import StandardScaler
from sklearn.utils import check_array
......@@ -571,7 +572,7 @@ class AELstmTF2(BaseDetector):
lstm_activation=self.lstm_activation,
recurrent_activation=self.recurrent_activation)
early_stop = keras.callbacks.EarlyStopping(monitor = 'val_loss', patience = self.patience)
early_stop = EarlyStopping(monitor = 'val_loss', patience = self.patience)
self.history_ = self.model_.fit(X_image, X_image,
epochs=self.epochs,
......@@ -660,9 +661,9 @@ class AELstmTF2(BaseDetector):
class GRU64(BaseDetector):
def __init__(self,
#nr_timeseries,
patience=5,
nr_timesteps,
#nr_timeseries,
nr_timesteps,
patience=5,
loss=mean_squared_error,
optimizer='adam',
gru_units=64,
......@@ -749,7 +750,7 @@ class GRU64(BaseDetector):
X_image = X_image.swapaxes(1, 2)
self.model_ = self._build_model(gru_units=self.gru_units)
early_stop = keras.callbacks.EarlyStopping(monitor = 'val_loss', patience = self.patience)
early_stop = EarlyStopping(monitor = 'val_loss', patience = self.patience)
self.history_ = self.model_.fit(X_image, X_image,
epochs=self.epochs,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment