Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,12 @@ from sklearn.preprocessing import OneHotEncoder, StandardScaler
|
|
| 5 |
from keras.models import load_model
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
from keras.layers import LSTM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def custom_lstm(*args, **kwargs):
|
| 10 |
kwargs.pop('time_major', None) # Remove the unsupported argument
|
|
|
|
| 5 |
from keras.models import load_model
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
from keras.layers import LSTM
|
| 8 |
+
import keras
|
| 9 |
+
from keras import backend as K
|
| 10 |
+
|
| 11 |
+
@keras.saving.register_keras_serializable()
|
| 12 |
+
def custom_mse(y_true, y_pred):
|
| 13 |
+
return K.mean(K.square(y_pred - y_true))
|
| 14 |
|
| 15 |
def custom_lstm(*args, **kwargs):
|
| 16 |
kwargs.pop('time_major', None) # Remove the unsupported argument
|