Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deepmd/pt/model/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_spin_model(model_params):
"env_protection" not in model_params["descriptor"]
or model_params["descriptor"]["env_protection"] == 0.0
):
model_params["descriptor"]["env_protection"] = 1e-6
model_params["descriptor"]["env_protection"] = 0.01
Comment thread
iProzd marked this conversation as resolved.
if model_params["descriptor"]["type"] in ["se_e2_a"]:
# only expand sel for se_e2_a
model_params["descriptor"]["sel"] += model_params["descriptor"]["sel"]
Expand Down
8 changes: 8 additions & 0 deletions doc/model/train-energy-spin.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ See `se_e2_a` examples in `$deepmd_source_dir/examples/spin/se_e2_a/input_torch.
List of float values with shape of `ntypes` or `ntypes_spin` or one single float value for all types,
only used when {ref}`use_spin <model/spin[ener_spin]/use_spin>` is True for each atom type.

:::{note}
It should be noted that the spin models in PyTorch/DP are capable of addressing scenarios where the spin approaches zero
(indicating the virtual atom is in close proximity to the real atom) by adjusting the non-zero
{ref}`env_protection <model[standard]/descriptor[se_e2_a]/env_protection>` parameter within the descriptor.
This parameter is set to 0.01 by default in the spin model. It appears that a value of 0.01 is generally sufficient for maintaining model stability.
For systems with nearly zero spin, users can also consider tuning this parameter to potentially enhance stability.
:::
Comment thread
iProzd marked this conversation as resolved.

## Spin Loss

The spin loss function $L$ for training energy is given by
Expand Down