File size: 2,109 Bytes
ba0c071
 
 
 
 
c00fd86
ba0c071
 
 
c00fd86
 
ba0c071
 
 
 
 
 
c00fd86
ba0c071
 
 
c00fd86
 
ba0c071
 
 
 
 
c00fd86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba0c071
 
c00fd86
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: mit
pipeline_tag: graph-ml
---

# Shift Current Prediction (DPA3-$\sigma$)

This model is based on the DPA3 architecture for predicting shift current in materials.

The training data follow a **long-tail distribution**, thus the model is trained in **log1p space** using `log1p(x) = log(1 + x)`.  Predictions are also in log1p space.  

## Dependency

Install DeepMD:

```bash
pip install deepmd-kit
````

## Usage

Basic command:

```bash
dp --pt test \
   -m model.weights.pt \
   -f [INPUT_FILE] \
   -n 0 \
   -d [OUTPUT_PREFIX]
```

* `-m model.weights.pt`: path to the trained model.
* `-f [INPUT_FILE]`: a text file listing all systems to be evaluated.
* `-d [OUTPUT_PREFIX]`: prefix of the output result files.

Example:

```bash
dp --pt test \
   -m model.weights.pt \
   -f sys_test.txt \
   -n 0 \
   -d test_result
```

## Input format

### 1. System list file (`[INPUT_FILE]`)

`[INPUT_FILE]` is a plain text file.
Each line contains the path to a DeepMD-format system directory, for example:

```text
.../mp-14_Se_32_spg152_gap0.88eV/
.../mp-19_Te_32_spg152_gap0.19eV/
.../mp-154_N2_23_spg198_gap7.34eV/
.../mp-181_KGa3_spg119_gap0.22eV/
.../mp-189_SiRu_23_spg198_gap0.23eV/

```

### 2. System directory layout (DeepMD npy format)

Each system directory must follow the standard DeepMD **npy** structure, such as:

```text
system_X/
└── set.000/
    β”œβ”€β”€ box.npy
    β”œβ”€β”€ coord.npy
    β”œβ”€β”€ v.npy
β”œβ”€β”€ type_map.raw
└── type.raw
```

Notes:

* The `.npy` dataset can be converted from VASP using official DeepMD tools.
* A placeholder `v.npy` file is required; writing zeros in it is sufficient.

## Output

Running inference produces a file like:

```text
test_result_property.out.0
```

A typical block looks like:

```text
# /path/to/system_X/: data_property pred_property
0.0000000000000000e+00  2.04...
# /path/to/system_Y/: data_property pred_property
0.0000000000000000e+00  2.35...
```

* Lines starting with `#` indicate the system being evaluated.
* Each numeric line contains the reference value (if available) and the model prediction.