You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Professor, when i read your paper, i have an idea that is to add weather(eg precipitation) into the model, then I have done something to the DeepJMQR model as following:
---------------- Independent deep learning models for mean and quantiles
def tilted_loss(q,y,f):
e = (y-f)
# The term inside k.mean is a one line simplification of the first equation
return K.mean(q*e + K.clip(-e, K.epsilon(), np.inf), axis=-1)
def build_model(loss="mse", num_outputs=1):
model = Sequential()
But there is a error:ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 2 arrays
I have tried to solve this problem, but failed. Could you give me a good idea?
Thank you very much!
The text was updated successfully, but these errors were encountered:
Hi, Professor, when i read your paper, i have an idea that is to add weather(eg precipitation) into the model, then I have done something to the DeepJMQR model as following:
weather data processing
weather_feats = weather['precipitation'].values[:,np.newaxis]
---------------- Build lags
weather_feats[:-NUM_LAGS,:] = weather_feats[NUM_LAGS:,:]
weather_feats_train = weather_feats[:i_train,:]
weather_feats_val = weather_feats[i_train:i_val,:]
weather_feats_test = weather_feats[i_val:i_test,:]
#深度学习模型for mean
---------------- Independent deep learning models for mean and quantiles
def tilted_loss(q,y,f):
e = (y-f)
# The term inside k.mean is a one line simplification of the first equation
return K.mean(q*e + K.clip(-e, K.epsilon(), np.inf), axis=-1)
def build_model(loss="mse", num_outputs=1):
model = Sequential()
print ("\nTraining NN for mean...")
checkpoint best model
checkpoint = ModelCheckpoint("weights_mean.best.hdf5", monitor='val_loss', verbose=1, save_best_only=True, mode='min')
fit model to the mean
model_mean = build_model(loss="mse", num_outputs=1)
model_mean.summary()
model_mean.fit(
[X_train[:,:,:,:,np.newaxis],weather_feats_train[:,:]],
y_train[:,:,:,np.newaxis],
batch_size=128,
epochs=N_EPOCHS, #100
validation_data=([X_val[:,:,:,:,np.newaxis],weather_feats_val[:,:]],y_val[:,:,:,np.newaxis]),
callbacks=[checkpoint],
verbose=0)
But there is a error:ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 2 arrays
I have tried to solve this problem, but failed. Could you give me a good idea?
Thank you very much!
The text was updated successfully, but these errors were encountered: