Example #1
0
n_cells = 200
n_features = 5

dataM = DataManager(path="data/", filter_items=["pm25", "temperature", "wind"])
station82_pm25 = dataM.get_pm25("84")
station82_t = dataM.get_temperature("82")
station82_w = dataM.get_wind("82")

n_size = 100
n_input_steps = 24 * 7 * semana
n_output_steps = 24 * 3
data_pm25 = np.copy(station82_pm25.CONCENTRATION.values)
data_t = np.copy(station82_t.Value.values)
data_w = np.copy(station82_w.Value.values)

ensembles_pm25 = dataM.generate_ensambles(data_pm25, 2.4, n_size)
ensembles_t = dataM.generate_ensambles(data_t, 0.5, n_size)
ensembles_w = dataM.generate_ensambles(data_w, 0.05, n_size)

file_name = "m_Weeks_" + str(semana) + "_hidden_" + str(
    n_LSTM_hidden_layers) + "_cells_" + str(
        n_cells) + "_" + mls_label[param] + ".h5"
titulo = mls_label[param] + str(semana) + "_hidden_" + str(
    n_LSTM_hidden_layers) + "_cells_" + str(n_cells)
mls = CnnMeteo(n_input_steps,
               n_features,
               n_output_steps,
               drop=True,
               n_LSTM_hidden_layers=n_LSTM_hidden_layers,
               n_cells=n_cells)
mls[param].load(file_name)
Example #2
0
for physical_device in physical_devices:
    tf.config.experimental.set_memory_growth(physical_device, True)

warnings.filterwarnings('ignore')
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'

dataM = DataManager(path="data/", filter_items=["pm25", "temperature", "wind"])
station82_pm25 = dataM.get_pm25("82")
station82_t = dataM.get_temperature("271")
station82_w = dataM.get_wind("271")
weeks = 2
n_input_steps = 24 * 7 * weeks
data = station82_pm25.CONCENTRATION.values[:n_input_steps]
n_size = data.size
ensembles = dataM.generate_ensambles(data, 2.4, 100)
cov1 = dataM.calculate_cov(ensembles)
cov2 = dataM.calculate_cov2(ensembles)

##Make a 3D plot
fig = plt.figure()
ax = fig.gca(projection='3d')
x = np.linspace(-10, 10, n_size)
y = np.linspace(-10, 10, n_size)
X, Y = np.meshgrid(x, y)
ax.plot_surface(X, Y, cov2, cmap='viridis', linewidth=0)
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
ax.set_zlabel('Z axis')
plt.show()