-
Notifications
You must be signed in to change notification settings - Fork 703
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
rename train_x_all to train_x_pde #1113
base: master
Are you sure you want to change the base?
Conversation
This resolves a TODO
have you double-checked if all classes using |
Grepping for |
@@ -100,9 +100,7 @@ def __init__( | |||
|
|||
self.auxiliary_var_fn = auxiliary_var_function | |||
|
|||
# TODO: train_x_all is used for PDE losses. It is better to add train_x_pde | |||
# explicitly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented here, it is better to add train_x_pde
, not replace train_x_all
with train_x_pde
. In some cases, we may actually use the meaning of train_x_all
, but I am not sure which case. Need to look at all the code carefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked over the code, and I can't find a place where train_x_all
does not contain PDE residual points.
If I added train_x_pde
in addition to train_x_all
, what would be different about them? The only thing that I can think of is that train_x_pde
would only contain points in the domain as opposed to train_x_all
also containing points on the boundary (or on the initial conditions in TimePDE).
What do you recommend for how to add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
train_x_all
contains all points (unordered, and does not have duplication). train_x_bc
is the points for BC losses (may have have duplication). There are cases where there are only BC losses and no PDE losses. So, it is better to add train_x_pde
. That is why we need the following if
Line 164 in b87c1c6
if self.pde is not None: |
So inside this if
, we should add
self.train_x_pde = train_x_all # Do deep copy
Otherwise, self.train_x_pde
is an empty array. We may also need to modify other places.
This makes the code clean and easier to understand. But it uses more memory.
This resolves a TODO
Was split off from #1108