-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix bugs in DataLoader and tutorial5 notebook #376
base: 0.2
Are you sure you want to change the base?
Conversation
8cac473
to
a7d4582
Compare
be1d561
to
968c1a1
Compare
03710e0
to
196d60b
Compare
…rst attempt with PINN
…__torch_functions__ and __mul__
@@ -53,11 +55,20 @@ def __init__( | |||
:param torch.nn.Module loss: The loss function used as minimizer, | |||
default :class:`torch.nn.MSELoss`. | |||
""" | |||
if optimizers is None: | |||
optimizers = TorchOptimizer(torch.optim.Adam, lr=0.001) |
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.
why are you not passing kwargs?
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.
kwargs are passed when TorchOptimizer is initialized outside the Solver class
from pina.optim import TorchOptimizer
from pina.solver import PINN
from torch.optim import SGD
optimizer = TorchOptimizer(SGD, lr=0.1, ...)
in_ = LabelTensor(torch.rand((10,2)), ['u_0', 'u_1'])
out_ = LabelTensor(torch.rand((10,1)), ['u'])
class TestProblem(AbstractProblem):
input_variables = ['u_0', 'u_1']
output_variables = ['u']
conditions = {
'data': Condition(input_points=in_, output_points=out_),
}
solver = SupervisedSolver(problem=problem, model=model, optimizer=optimizer)
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.
Can we pass the standard torch optimizer and inside solvers do the wrapper? To me, for the user, this is more intuitive
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.
@ndem0 what do you think?
bea50b4
to
00f1415
Compare
…LabelParameter class (equivalent of LabelTensor for torch.nn.Parameters)
No description provided.