Skip to content

Support higher dimension outputs in TorchMD-Net #198

Open
@RaulPPelaez

Description

@RaulPPelaez

Right now the TorchMD_Net module is tied to the idea that only one thing (and maybe its derivative) is returned:

With TensorNet it might be interesting to have more outputs. Say a scalar (energies), minus its derivative (forces) and some tensor feature.

I would like to discuss how to include this functionality while leaving the current TorchMD_Net interface as unmodified as possible.

A way to do this would be:

  • Change the return type of TorchMD_Net to be an Union[Tensor, List[Tensor]]. derivative, if true, only diffs the first tensor.
    ) -> Tuple[Tensor, Optional[Tensor]]:

    The consequences of this is a possible TorchScript nightmare
  • Change the output models to take in a List[Tensor] for v. For instance here:
    def pre_reduce(self, x, v: Optional[torch.Tensor], z, pos, batch):

cc @guillemsimeon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions