SJ001/AI-Feynman

Type error in compositionality

Opened this issue · 0 comments

The try-except was removed from the following block:
try:
succ_grad = evaluate_derivatives(pathdir,filename,model_feynman)
except:
succ_grad = 0
Execution error at grad_evaluated = evaluate_derivatives(directory, filename, model_feynman)
File “.../site-packages/torch/nn/functional.py”, line 1847, in linear
return torch._C._nn.linear(input, weight, bias)
RuntimeError: expected scalar type Float but found Double
Operation: evaluate_derivatives (in S_NN_get_gradients.py), after printing “Checking for compositionality...”
Line:
pts = torch.tensor(pts)
Partial traceback:
File “.../site-packages/torch/nn/functional.py”, line 1847, in linear
return torch._C._nn.linear(input, weight, bias)
RuntimeError: expected scalar type Float but found Double
The above error occurs every time “evaluate_derivatives” is called, which implies that “compositionality” never succeeds.
Request: would it be possible, if this bug is corrected, to also update the code on PyPI?