arkadaw9 / pgnn Goto Github PK
View Code? Open in Web Editor NEWPhysics-guided Neural Networks (PGNN) : An Application In Lake Temperature Modelling
Physics-guided Neural Networks (PGNN) : An Application In Lake Temperature Modelling
Hello I am trying to run your code on colab.
But I am getting the following error I can't see how I may fix it. Any ideas?
Traceback (most recent call last):
File "PGNN.py", line 148, in <module>
PGNN_train_test(optimizer_name, optimizer_val, drop_frac, use_YPhy, iteration, n_layers, n_nodes, tr_size, lamda, lake_name)
File "PGNN.py", line 110, in PGNN_train_test
spio.savemat(results_name, {'train_loss_1':history.history['loss_1'], 'val_loss_1':history.history['val_loss_1'], 'train_rmse':history.history['root_mean_squared_error'], 'val_rmse':history.history['val_root_mean_squared_error'], 'test_rmse':test_score[2]})
KeyError: 'loss_1'
Hello, I have tried running your code following your article.
However, I found that tensorflow only calculates the gradients based on the MSE part in the combined_loss, meanwhile neglecting the phy_loss term.
For instance, I tried training the model only with the phy_loss: model.compile(loss=phyloss, ...)
, it will return "ValueError: No gradients provided for any variable, XXXXX".
I also tried tf.GradientTape() to calculated the gradients. The gradients calculated using the phyloss is a list of None value (i.e., [None, None, None, None, None, None, None, None])
with tf.GradientTape() as tape:
Y_pred = model(trainX)
#loss = mean_squared_error(trainY, Y_pred)
#loss = totloss(trainY, Y_pred)
loss = phyloss(trainY, Y_pred)
grads = tape.gradient(loss, model.trainable_variables)
Hello,
I have tried running your code following your article (https://arxiv.org/abs/1710.11431).
It runs fine but I don't understand how each of the 12 columns in the Xc and uX1,2 arrays relate to the names of the input drivers listed in table 1 of the article (p.6).
Which column is the 'Day of Year', 'Depth', etc ?
Is there any way to find the original dataset, before any transformation (standardization) is performed on the data ?
Thanks,
Best regards,
Clément
I am trying to use your approach for another Physics-guided problem and have problems replicating it. I have backtracked your physical loss to Xc_doy1 and Xc_doy2, which are in the MatLab files with dimensions 649723x12. I have trouble understanding what these values actually stand for. Are these 649723 temperature samples at 12 different depths in the lake?
Hi,
I am having the problem, that i can't open the mat-files:
mat = sio.loadmat("mendota.mat", squeeze_me=True,
variable_names=['Y','Xc_doy','Modeled_temp'])
leads to:
ValueError: Unknown mat file type, version 97, 116
Keras v2.6.0
Scipy v1.8.0
Tensorflow 2.6.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.