<jupyter_start><jupyter_text>Create model<jupyter_code>encoder_input_length =  14*85 #day*timestep
decoder_input_length = 85 #timestep, output length will be the same as decoder input length

model = create_model(encoder_input_length,decoder_input_length)
model.summary()
file_path = './weights/seq2seq_14.h5'

model.load_weights(file_path)<jupyter_output>WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:190: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:197: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:203: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:207: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:216: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.

WARNING:tenso[...]<jupyter_text>Data preprocess<jupyter_code>data_2018 = pd.read_csv('./example/example_2018.csv',header=None).values
data_2019 = pd.read_csv('./example/example_2019.csv',header=None).values
data_2018 = data_2018.reshape(-1,85,1)
data_2019 = data_2019.reshape(-1,85,1)
X, X2, y = buildData(data_2019,data_2018)
X = smooth(X)
X2 = smooth(X2)
X.shape, X2.shape, y.shape<jupyter_output><empty_output><jupyter_text>Forecasting<jupyter_code>predict_result = model.predict([X, X2])
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates

start_time = '05:00:00'
date_list= []
for i in range(85):
    date_list.append(datetime.datetime.strptime(start_time,'%H:%M:%S')
                     +datetime.timedelta(minutes=10*i))
predict_result = denormalized(predict_result)
y = denormalized(y)
lines = []
day = 0
fig, ax = plt.subplots(figsize=(10,5))
ax.plot(date_list[13:79],predict_result[day,13:79,:], alpha=0.7,linestyle='-', color='black',label="pred")
ax.plot(date_list[13:79],y[day].ravel()[13:79],linestyle='-.', alpha=0.7, color='#4d4d4d',label="real")
ax.set_ylabel('Antipsoriasis (mW/$m^{2}$)')
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
ax.xaxis.set_major_locator(mdates.HourLocator(interval=1))
# ax2.set_ylabel('Error (%)')
ax.legend(lines, ['pred', 'real', 'error'],
      loc='upper right', frameon=False)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14627949183303085, 'fraction_numerical': 0.04827586206896552, 'mean_word_length': 6.896848137535817, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '123178', 'license': 'Apache-2.0', 'n_tokens_mistral': 1075, 'n_tokens_neox': 997, 'n_words': 147, 'path': 'Prediction_example.ipynb', 'repo_name': 'cmb-chula/SurfUVNet', 'size': '2755'}