deepmd.tf.infer.deep_polar#

Classes#

DeepGlobalPolar

Old tensor models from v1, which has no gradient output.

DeepPolar

Deep polar model.

Module Contents#

class deepmd.tf.infer.deep_polar.DeepGlobalPolar(model_file: str, *args: Any, auto_batch_size: bool | int | deepmd.utils.batch_size.AutoBatchSize = True, neighbor_list: ase.neighborlist.NewPrimitiveNeighborList | None = None, **kwargs: Any)[source]#

Bases: deepmd.infer.deep_tensor.OldDeepTensor

Old tensor models from v1, which has no gradient output.

property output_tensor_name: str#

The name of the tensor.

eval(coords: numpy.ndarray, cells: numpy.ndarray | None, atom_types: list[int] | numpy.ndarray, atomic: bool = False, fparam: numpy.ndarray | None = None, aparam: numpy.ndarray | None = None, mixed_type: bool = False, **kwargs) numpy.ndarray[source]#

Evaluate the model.

Parameters:
coords

The coordinates of atoms. The array should be of size nframes x natoms x 3

cells

The cell of the region. If None then non-PBC is assumed, otherwise using PBC. The array should be of size nframes x 9

atom_typeslist[int] or np.ndarray

The atom types The list should contain natoms ints

atomic

If True (default), return the atomic tensor Otherwise return the global tensor

fparam

Not used in this model

aparam

Not used in this model

mixed_type

Whether to perform the mixed_type mode. If True, the input data has the mixed_type format (see doc/model/train_se_atten.md), in which frames in a system may have different natoms_vec(s), with the same nloc.

Returns:
tensor

The returned tensor If atomic == False then of size nframes x output_dim else of size nframes x natoms x output_dim

property output_def: deepmd.dpmodel.output_def.ModelOutputDef#

Get the output definition of this model.

class deepmd.tf.infer.deep_polar.DeepPolar(model_file: str, *args: Any, auto_batch_size: bool | int | deepmd.utils.batch_size.AutoBatchSize = True, neighbor_list: ase.neighborlist.NewPrimitiveNeighborList | None = None, **kwargs: Any)[source]#

Bases: deepmd.infer.deep_tensor.DeepTensor

Deep polar model.

Parameters:
model_filePath

The name of the frozen model file.

*argslist

Positional arguments.

auto_batch_sizebool or int or AutoBatchSize, default: True

If True, automatic batch size will be used. If int, it will be used as the initial batch size.

neighbor_listase.neighborlist.NewPrimitiveNeighborList, optional

The ASE neighbor list class to produce the neighbor list. If None, the neighbor list will be built natively in the model.

**kwargsdict

Keyword arguments.

property output_tensor_name: str#

The name of the tensor.