How to customize my network when there are a set of pdes? #199
Unanswered
ZhenghaoYang19
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Shuheng.
I am facing with pdes like these:
I define my pde like: [loss_n, loss_Nw, loss_Nv]
conditions like: [IBVP1D(), IVP(), IVP()]
nets like: [FCNN(), FCNN(), FCNN()]
and solvers like:
solver = Solver2D(
pde_system=pde,
conditions=conditions,
xy_min=(0, ts), # We can omit xy_min when both train_generator and valid_generator are specified
xy_max=(x_e, tf), # We can omit xy_max when both train_generator and valid_generator are specified
nets=nets,
train_generator=Generator2D(grid=(100, 100), xy_min=(0, ts), xy_max=(x_e, tf), method='equally-spaced-noisy'),
valid_generator=Generator2D(grid=(100, 100), xy_min=(0, ts), xy_max=(x_e, tf), method='equally-spaced'),
optimizer=optimizer,
)
But I got error message like:
Traceback (most recent call last):
File "/home/harry/Project/neurodiffeq/3inventory.py", line 323, in
solver.fit(max_epochs=8000, callbacks=[monitor_callback])
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 483, in fit
self.run_train_epoch()
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 418, in run_train_epoch
self._run_epoch('train')
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 397, in _run_epoch
closure(zero_grad=False)
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 366, in closure
funcs = [
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 367, in
self.compute_func_val(n, c, *batch) for n, c in zip(self.nets, self.conditions)
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/solvers.py", line 272, in compute_func_val
return cond.enforce(net, *coordinates)
File "/home/harry/anaconda3/envs/neurodiffeq/lib/python3.9/site-packages/neurodiffeq/conditions.py", line 57, in enforce
return self.parameterize(network_output, *coordinates)
TypeError: parameterize() takes 3 positional arguments but 4 were given
To be honest, I don't actuallt know where the problem is.
And also, how can I simplify my net because Nw, Nv are just functions of t?
Beta Was this translation helpful? Give feedback.
All reactions