Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'PhysicsInformedNN' Error #1

Open
javadshamsicodes opened this issue May 22, 2022 · 3 comments
Open

'PhysicsInformedNN' Error #1

javadshamsicodes opened this issue May 22, 2022 · 3 comments

Comments

@javadshamsicodes
Copy link

javadshamsicodes commented May 22, 2022

Hi, there is an error with 'PhysicsInformedNN' in model = PhysicsInformedNN(x0, u0, x1, u1, layers, dt, lb, ub, q, splitIdx1, splitIdx2, splitIdx3, Params).
Because 'PhysicInformed' object has no attribute 'initialize_NN'.

@ms140429
Copy link
Owner

Hi, there is an error with 'PhysicsInformedNN' in model = PhysicsInformedNN(x0, u0, x1, u1, layers, dt, lb, ub, q, splitIdx1, splitIdx2, splitIdx3, Params). Because 'PhysicInformed' object has no attribute 'initialize_NN'.

Hi javadshamsicodes,

Thanks for the feedback. However, the code runs well on my side. Can you please post your debug log or more details?

@javadshamsicodes
Copy link
Author

javadshamsicodes commented Jun 9, 2022

Sorry for my late response.
I get the following debug when I run the otherParams.

AttributeError Traceback (most recent call last)
Input In [17], in <cell line: 1>()
41 splitIdx3 = 120
42 Params = otherParams()
---> 44 model = PhysicsInformedNN(x0, u0, x1, u1, layers, dt, lb, ub, q, splitIdx1, splitIdx2, splitIdx3, Params)
45 model.train(Params.AdamEpoch)
47 L = np.exp(model.sess.run(model.L))

Input In [3], in PhysicsInformedNN.init(self, x0, u0, x1, u1, layers, dt, lb, ub, q, splitIdx1, splitIdx2, splitIdx3, otherParams)
20 self.splitIdx3 = splitIdx3
21 # Initialize NN
---> 22 self.weights, self.biases = self.initialize_NN(layers)
23 self.otherParams = otherParams
25 self.L = tf.Variable([2], dtype=tf.float32)

AttributeError: 'PhysicsInformedNN' object has no attribute 'initialize_NN'

@ms140429
Copy link
Owner

ms140429 commented Jun 9, 2022

Hi javadshamsicodes,

Thanks for the reply. The "initialized_NN" is defined on Line 100. Please check it. I guess you might run the code without initializing the class PhysicsInformedNN. Actually, you can directly run the code in Pycharm, which will automate everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants