DMFF (Differentiable Molecular Force Field) is a Jax-based python package that provides a full differentiable implementation of molecular force field models.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[12], line 2
1 param_grad_func = jax.grad(nbfunc, argnums=-1)
----> 2 pgrad = param_grad_func(positions, box, pairs, params)
3 pgrad["NonbondedForce"]["charge"]
[... skipping hidden 4 frame]
File ~/anaconda3/envs/dmff/lib/python3.9/site-packages/jax/_src/api.py:1120, in _check_input_dtype_revderiv(name, holomorphic, allow_int, x)
1117 if (dtypes.issubdtype(aval.dtype, np.integer) or
1118 dtypes.issubdtype(aval.dtype, np.bool_)):
1119 if not allow_int:
-> 1120 raise TypeError(f"{name} requires real- or complex-valued inputs (input dtype "
1121 f"that is a sub-dtype of np.inexact), but got {aval.dtype.name}. "
1122 "If you want to use Boolean- or integer-valued inputs, use vjp "
1123 "or set allow_int to True.")
1124 elif not dtypes.issubdtype(aval.dtype, np.inexact):
1125 raise TypeError(f"{name} requires numerical-valued inputs (input dtype that is a "
1126 f"sub-dtype of np.bool_ or np.number), but got {aval.dtype.name}.")
TypeError: grad requires real- or complex-valued inputs (input dtype that is a sub-dtype of np.inexact), but got int32. If you want to use Boolean- or integer-valued inputs, use vjp or set allow_int to True.
cell 5 line 7
should be
cell 8 line 2
reported error for
pairs