sciann / sciann-applications

A place to share problems solved with SciANN
https://www.sciann.com
Other
238 stars 128 forks source link

the eval. in SciModel and Functional in Burgers Equation example #10

Closed LiZiqian closed 4 years ago

LiZiqian commented 4 years ago

In this example, the evaluation section, says:

" There are two ways to evaluate the functionals. 1- eval without passing the model: Not suggested - the data should be provided in the same order as it was defined in the Functional. u.eval(m, [t_data, x_data])

2- eval with model (suggested): the data should be provided in the same order as it was defined in the SciModel. u.eval(m, [x_data, t_data]) "

I think the in the first item (in the Functional), the code should be u.eval(m, [x_data, t_data]), x should be at former, and t be at later, because when we construct model m = sn.SciModel([x, t], [L1, C1, C2, C3]), the consequence is [x, t] .

And then, for the second item (in the SciModel), why the code is the same with the previous one? Why not be 'u_pred = m.predict([x_test_line, t_test_line])' or 'u_pred = m.eval([x_test, t_test])' ? Because it says use the eval in SciModel. Why still call u.eval (the eval in Functional)?

sciann commented 4 years ago

Thanks @LiZiqian for pointing the typo - it is fixed now. The functional is defined as: sn.Functional('u', [t, x], 8*[20], 'tanh')

Therefore, for the first approach you need to pass: u.eval([t_data, x_data])

The order of t_data, x_data should follow the same rule as those in Functional.