Skip to content

Commit

Permalink
Remove deepxde example from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelburbulla committed Apr 22, 2024
1 parent 104146a commit 2968f1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/pde/test_deepxde.py → tests/pde/deepxde_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
torch.manual_seed(0)


def test_deepxde():
def deepxde_example():
"""Physics-informed DeepONet for Poisson equation in 1D.
Example from DeepXDE.
https://deepxde.readthedocs.io/en/latest/demos/operator/poisson.1d.pideeponet.html
Expand Down Expand Up @@ -96,4 +96,4 @@ def boundary(_, on_boundary):


if __name__ == "__main__":
test_deepxde()
deepxde_example()
10 changes: 4 additions & 6 deletions tests/pde/test_pideeponet.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ def v_boundary(y):
# operator = cti.operators.DeepNeuralOperator(dataset.shapes)

# Define and train model
trainer = cti.Trainer(
operator,
loss_fn=cti.pde.PhysicsInformedLoss(equation),
)
trainer.fit(dataset)
loss_fn = cti.pde.PhysicsInformedLoss(equation)
trainer = cti.Trainer(operator, loss_fn=loss_fn)
trainer.fit(dataset, epochs=100)

# Plot realizations of f(x)
n = 3
Expand Down Expand Up @@ -115,7 +113,7 @@ def v_boundary(y):
plt.plot(y, v[i].T, "-")
plt.xlabel("x")

plt.show()
plt.savefig("pideeponet.png", dpi=500)


if __name__ == "__main__":
Expand Down

0 comments on commit 2968f1f

Please sign in to comment.