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

Why does the output of the function 'neural_net_vessel1' go to the exponential of A? #1

Closed
YouqiongLiu opened this issue Jun 24, 2022 · 5 comments

Comments

@YouqiongLiu
Copy link

The valuable and enlightening research. and I've got a question to consult you.
Why does the output of the function 'neural_net_vessel1' go to the exponential of A ?
As follows,
def neural_net_vessel1(self, x, t):
Au = self.neural_net(tf.concat([x,t],1),self.weights1,self.biases1,self.layers)
A = Au[:,0:1]
u = Au[:,1:2]
p = Au[:,2:3]
return tf.exp(A), u, p

I'm looking forward to your reply soon.

@hieronimoDos
Copy link
Collaborator

A is the area and it should always be non-negative. For this reason, we use a trick where we consider that the neural net prediction as the logarithm of the area and compute its exponential. So, this exponential you see here is used to cancel the logarithm. This trick, meaning tf.exp(A) where A is tf.log(A), always provides non-negative predictions.

@YouqiongLiu
Copy link
Author

A is the area and it should always be non-negative. For this reason, we use a trick where we consider that the neural net prediction as the logarithm of the area and compute its exponential. So, this exponential you see here is used to cancel the logarithm. This trick, meaning tf.exp(A) where A is tf.log(A), always provides non-negative predictions.

What a good idea! Thanks.
For the prototype Y-shaped bifurcation, I cannot run the program 'Y_shaped.py' to reproduce the result as shown in Figure 6 in paper.
Is there any skill in here?

@hieronimoDos
Copy link
Collaborator

You need to run the code for a larger number of iterations. You need to change lines 103 and 104 in 'Y_shaped.py'

model.train(1,1e-3)
model.train(2,1e-4)

to

model.train(90000,1e-3)
model.train(40000,1e-4)

You can also check the paper to see the training details. I will correct the code to resolve any confusion.

@YouqiongLiu
Copy link
Author

You need to run the code for a larger number of iterations. You need to change lines 103 and 104 in 'Y_shaped.py'

model.train(1,1e-3)
model.train(2,1e-4)

to

model.train(90000,1e-3)
model.train(40000,1e-4)

You can also check the paper to see the training details. I will correct the code to resolve any confusion.

Thanks. I've only trained 40,000 times before.

@hieronimoDos
Copy link
Collaborator

I will close this for now and if you need more help send me an email.

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