Closed maxxxzdn closed 3 years ago
could you say me which was the shape of x in the initial condition ?
It was [batch_size,3]
but looks correct to me ?
and the shape of the predictions ?
[batch_size, 1]
Perhaps it worked fine, but I got this annoying UserWarning that [batch_size] != [batch_size,1]
ok :) if you shape your data correctly which is always batch size one, it works fine :)
I see. I will reshape my output tensor in the dataset then. Probably it makes sense to write some instructions for a dataset structure later on
https://github.com/ComputationalRadiationPhysics/NeuralSolvers/blob/2a9457257b35265d219db245eb765c6132559748/PINNFramework/InitalCondition.py#L28
/home/maxxxzdn/.local/lib/python3.8/site-packages/torch/nn/modules/loss.py:446: UserWarning: Using a target size (torch.Size([batch_size])) that is different to the input size (torch.Size([batch_size, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size. return F.mse_loss(input, target, reduction=self.reduction)
Using
prediction = model(x).reshape(-1)
solves the problem