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

Improve Parsing with Symbolics #678

Closed
wants to merge 49 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
043d429
begin symbolics overhaul
xtalax Apr 12, 2023
867ed37
include
xtalax Apr 12, 2023
9d52d56
further progress
xtalax Apr 13, 2023
5e27b18
start new loss
xtalax Apr 27, 2023
1947fb8
cardinalize eqs
xtalax May 16, 2023
27fc8bc
add todos
xtalax May 17, 2023
1fcd390
polish loss and refactor
xtalax May 25, 2023
b85eaa8
fix
xtalax May 25, 2023
8e39ede
"final" parsing updates
xtalax May 26, 2023
0f99811
oops
xtalax May 26, 2023
60aaa6b
Merge branch 'SciML:master' into parsing
xtalax May 30, 2023
3806caf
test fixes
xtalax May 30, 2023
c23df24
more fixes
xtalax May 30, 2023
5fdc7a5
move to varmap, deprecate old parsing
xtalax May 31, 2023
5891313
more fixes
xtalax Jun 5, 2023
18c3449
fix the tests a bit more
xtalax Jun 7, 2023
82191e7
remove transform expression
xtalax Jun 7, 2023
70f1ce3
reinstate dot, closer
xtalax Jun 8, 2023
b3967aa
last confusing errors?
xtalax Jun 15, 2023
17d0150
fix test
xtalax Jun 16, 2023
0011392
add multioutput
xtalax Jun 19, 2023
8c3ad76
ignore ds_store
xtalax Jun 19, 2023
a949169
change to x(0)
xtalax Jul 31, 2023
edb83d3
Merge branch 'parsing' into rel
xtalax Jan 3, 2024
8704b2e
Merge pull request #3 from SciML/rel
xtalax Jan 3, 2024
6df392a
fix deved package
xtalax Jan 4, 2024
a7d61ec
ditto
xtalax Jan 4, 2024
1cd8076
last ditch fix symbolic error
xtalax Jan 4, 2024
1299565
fix switch
xtalax Jan 4, 2024
aa12321
undo stupidity
xtalax Jan 4, 2024
cd0052e
fix switch
xtalax Jan 4, 2024
2e57081
"
xtalax Jan 4, 2024
39bd9c7
rerun tests
xtalax Jan 7, 2024
aafd11d
"
xtalax Jan 7, 2024
cf17091
test
xtalax Jan 8, 2024
4a0ee8a
Merge branch 'master' into parsing
xtalax Jan 8, 2024
765c047
try other method
xtalax Jan 12, 2024
8406bed
rvcat
xtalax Jan 18, 2024
82bd6bd
Merge branch 'master' into parsing
xtalax Jan 18, 2024
60e2c8c
try something
xtalax Jan 18, 2024
492c2df
test
xtalax Jan 18, 2024
fa988ad
remove show
xtalax Jan 18, 2024
da31f19
Merge branch 'parsing' into tmp
xtalax Feb 9, 2024
e2460f6
Merge pull request #4 from SciML/tmp
xtalax Feb 9, 2024
a49b1b7
arrayop wrap
xtalax Feb 13, 2024
5fa91f3
fix
xtalax Feb 13, 2024
89ad740
Merge branch 'parsing' into tmp1
xtalax Feb 13, 2024
143367c
Merge pull request #5 from SciML/tmp1
xtalax Feb 13, 2024
4f0c9b5
almost
xtalax Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cardinalize eqs
  • Loading branch information
xtalax committed May 16, 2023
commit 1947fb8c5dc290b813d2a701f7271b6aac05739a
1 change: 1 addition & 0 deletions src/NeuralPDE.jl
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ using QuasiMonteCarlo
using RuntimeGeneratedFunctions
using SciMLBase
using PDEBase
using PDEBase: cardinalize_eqs!
using Statistics
using ArrayInterface
import Optim
1 change: 1 addition & 0 deletions src/discretize.jl
Original file line number Diff line number Diff line change
@@ -400,6 +400,7 @@ For more information, see `discretize` and `PINNRepresentation`.
"""
function SciMLBase.symbolic_discretize(pde_system::PDESystem,
discretization::PhysicsInformedNN)
cardinalize_eqs!(pde_system)
eqs = pde_system.eqs
bcs = pde_system.bcs
chain = discretization.chain
6 changes: 3 additions & 3 deletions src/new_loss.jl
Original file line number Diff line number Diff line change
@@ -56,16 +56,16 @@ function parse_equation(pinnrep::PINNRepresentation, ex; is_integral = false,
op_rules = [@rule $(op)(~~a) => broadcast(op, ~a...) for op in ex_ops]

dummyvars = @variables phi, u, x, θ
deriv_rules = generate_derivatives_rules(eq, eqdata, dummyvars)
deriv_rules = generate_derivative_rules(eq, eqdata, dummyvars)

ch = Postwalk(Chain([deriv_rules; op_rules]))
expr = ch(expr)

args = [phi, u, x, θ]

ex = Func(args, [], eq.rhs) |> toexpr

ex = Func(args, [], ch(eq.lhs)) |> toexpr

return ex
end

function generate_derivative_rules(eq, eqdata, dummyvars)