Hi albanD,
Thanks for the comment. You’re right: the loss plot reflects the fact that the curve does not look good.
So I tried a model with a higher capacity as follows and the curve still looks as bad.
Do you find any mistake in my get_jacobian function?
class Net(nn.Module):
    
    def __init__(self):
        super().__init__()
        
        self.main = nn.Sequential(
            nn.Linear(1, 100),
            nn.ReLU(),
            nn.Linear(100, 100),
            nn.ReLU(),
            nn.Linear(100, 100),
            nn.ReLU(),
            nn.Linear(100, 100),
            nn.ReLU(),
            nn.Linear(100, 100),
            nn.ReLU(),
            nn.Linear(100, 1)
        )
        
    def forward(self, x):
        return self.main(x)