Skip to content

Commit

Permalink
array->ndarray
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Wang committed Sep 11, 2024
1 parent 836e6c2 commit 1afca1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions deepmd/pt/model/atomic_model/base_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class BaseAtomicModel(torch.nn.Module, BaseAtomicModel_):
of the atomic model. Implemented by removing the pairs from the nlist.
rcond : float, optional
The condition number for the regression of atomic energy.
preset_out_bias : Dict[str, List[Optional[np.array]]], optional
preset_out_bias : Dict[str, List[Optional[np.ndarray]]], optional
Specifying atomic energy contribution in vacuum. Given by key:value pairs.
The value is a list specifying the bias. the elements can be None or np.array of output shape.
The value is a list specifying the bias. the elements can be None or np.ndarray of output shape.
For example: [None, [2.]] means type 0 is not set, type 1 is set to [2.]
The `set_davg_zero` key in the descrptor should be set.
Expand All @@ -81,7 +81,7 @@ def __init__(
atom_exclude_types: List[int] = [],
pair_exclude_types: List[Tuple[int, int]] = [],
rcond: Optional[float] = None,
preset_out_bias: Optional[Dict[str, np.array]] = None,
preset_out_bias: Optional[Dict[str, np.ndarray]] = None,
):
torch.nn.Module.__init__(self)
BaseAtomicModel_.__init__(self)
Expand Down
12 changes: 6 additions & 6 deletions deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def model_forward_auto_batch_size(*args, **kwargs):

def _make_preset_out_bias(
ntypes: int,
ibias: List[Optional[np.array]],
) -> Optional[np.array]:
ibias: List[Optional[np.ndarray]],
) -> Optional[np.ndarray]:
"""Make preset out bias.
output:
Expand Down Expand Up @@ -242,7 +242,7 @@ def compute_output_stats(
keys: Union[str, List[str]] = ["energy"],
stat_file_path: Optional[DPPath] = None,
rcond: Optional[float] = None,
preset_bias: Optional[Dict[str, List[Optional[np.array]]]] = None,
preset_bias: Optional[Dict[str, List[Optional[np.ndarray]]]] = None,
model_forward: Optional[Callable[..., torch.Tensor]] = None,
atomic_output: Optional[FittingOutputDef] = None,
):
Expand All @@ -264,9 +264,9 @@ def compute_output_stats(
The path to the stat file.
rcond : float, optional
The condition number for the regression of atomic energy.
preset_bias : Dict[str, List[Optional[np.array]]], optional
preset_bias : Dict[str, List[Optional[np.ndarray]]], optional
Specifying atomic energy contribution in vacuum. Given by key:value pairs.
The value is a list specifying the bias. the elements can be None or np.array of output shape.
The value is a list specifying the bias. the elements can be None or np.ndarray of output shape.
For example: [None, [2.]] means type 0 is not set, type 1 is set to [2.]
The `set_davg_zero` key in the descrptor should be set.
model_forward : Callable[..., torch.Tensor], optional
Expand Down Expand Up @@ -405,7 +405,7 @@ def compute_output_stats_global(
ntypes: int,
keys: List[str],
rcond: Optional[float] = None,
preset_bias: Optional[Dict[str, List[Optional[np.array]]]] = None,
preset_bias: Optional[Dict[str, List[Optional[np.ndarray]]]] = None,
model_pred: Optional[Dict[str, np.ndarray]] = None,
atomic_output: Optional[FittingOutputDef] = None,
):
Expand Down

0 comments on commit 1afca1c

Please sign in to comment.