Skip to content

Commit cacfeb5

Browse files
committed
Update AC-inference with comments
1 parent 2e2ec24 commit cacfeb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/AC-inference.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313
# Put params into a list
1414
params = [tf.Variable(0.0, dtype=tf.float32), tf.Variable(0.0, dtype=tf.float32)]
1515

16+
# Define f_model, note the `vars` argument. Inputs must follow this order!
1617
def f_model(u_model, vars, x, t):
1718
u = u_model(tf.concat([x,t],1))
1819
u_x = tf.gradients(u, x)
1920
u_xx = tf.gradients(u_x, x)
2021
u_t = tf.gradients(u,t)
21-
c1 = vars[0]
22-
c2 = vars[1]
22+
c1 = vars[0] # tunable param 1
23+
c2 = vars[1] # tunable param 2
2324
f_u = u_t - c1*u_xx + c2*u*u*u - c2*u
2425
return f_u
2526

27+
2628
# Import data, same data as Raissi et al
2729

2830
data = scipy.io.loadmat('AC.mat')

0 commit comments

Comments
 (0)