| This is part of the pytorch module | |
| It is only available if you configure PLUMED with ./configure –enable-modules=pytorch . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list. |
Load a PyTorch model compiled with TorchScript.
This can be a function defined in Python or a more complex model, such as a neural network optimized on a set of data. In both cases the derivatives of the outputs with respect to the inputs are computed using the automatic differentiation (autograd) feature of Pytorch.
By default it is assumed that the model is saved as: model.ptc, unless otherwise indicated by the FILE keyword. The function automatically checks for the number of output dimensions and creates a component for each of them. The outputs are called node-i with i between 0 and N-1 for N outputs.
Note that this function is active only if LibTorch is correctly linked against PLUMED. Please check the instructions in the PYTORCH (Machine Learning Collective Variables) page.
#SETTINGS AUXFILE=regtest/pytorch/rt-pytorch_model_2d/torch_model.ptc phi: TORSIONATOMS=5,7,9,15 psi: TORSIONthe four atoms involved in the torsional angleATOMS=7,9,15,17 model: PYTORCH_MODELthe four atoms involved in the torsional angleFILE=torch_model.ptccould not find this keywordARG=phi,psi PRINTcould not find this keywordFILE=COLVARthe name of the file on which to output these quantitiesARG=model.node-0,model.node-1the input for this action is the scalar output from one or more other actions.