Updates to tutorial and run post codacy changes

This commit is contained in:
Matteo Bertocchi
2025-03-10 17:18:48 +01:00
committed by Nicola Demo
parent 9e55746546
commit b38b0894b1
27 changed files with 952 additions and 393 deletions

View File

@@ -107,9 +107,8 @@ problem.discretise_domain(1, 'grid', domains=['bound_cond0','bound_cond1'])
from pina.optim import TorchScheduler
# training with PINN and visualize results
model=FeedForward(input_dimensions=1, output_dimensions=1, layers=[100, 100, 100])
pinn = PINN(problem=problem,
model=model,
model=FeedForward(input_dimensions=1, output_dimensions=1, layers=[100, 100, 100]),
scheduler=TorchScheduler(torch.optim.lr_scheduler.MultiStepLR, # Pass the class directly, not an instance
milestones=[1000,2000,3000,4000],
gamma=0.9))
@@ -119,7 +118,7 @@ trainer.train()
# training with PINN and visualize results
sapinn = SAPINN(problem=problem,
model=model,
model=FeedForward(input_dimensions=1, output_dimensions=1, layers=[100, 100, 100]),
scheduler_model=TorchScheduler(torch.optim.lr_scheduler.MultiStepLR,
milestones=[1000,2000,3000,4000],
gamma=0.9))