Skip to content

Commit 088ad5d

Browse files
committed
Update ACE run-experiments.jl and documentation.
1 parent 204b8d4 commit 088ad5d

File tree

4 files changed

+67
-64
lines changed

4 files changed

+67
-64
lines changed

docs/src/index.md

+30-29
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ The input parameters are listed below:
7777

7878
| Input parameter | Description | E.g. |
7979
|----------------------|-----------------------------------------------------------|---------------------|
80-
| experiment_path | Experiment path | TiO2/ |
80+
| experiment_path | Experiment path | HfB2/ |
8181
| dataset_path | Dataset path | data/ |
82-
| trainingset_filename | Training datasets filename | TiO2trainingset.xyz |
83-
| testset_filename | Test datasets filename | TiO2testset.xyz |
84-
| n_train_sys | No. of atomic configurations in training dataset | 80 |
85-
| n_test_sys | No. of atomic configurations in test dataset | 20 |
82+
| dataset_filename | Dataset filename | HfB2-n24-585.exyz |
83+
| split_prop | Split proportion. E.g. 0.8 training, 0.2 test. | 0.8 |
84+
| max_train_sys | Max. no. of atomic systems in training dataset | 800 |
85+
| max_test_sys | No. of atomic systems in test dataset | 200 |
8686
| n_body | Body order | 3 |
8787
| max_deg | Maximum polynomial degree | 3 |
8888
| r0 | An estimate on the nearest-neighbour distance for scaling | 1.0 |
@@ -92,29 +92,30 @@ The input parameters are listed below:
9292
| w_e | Energy weight | 1.0 |
9393
| w_f | Force weight | 1.0 |
9494

95+
9596
Run fitting process
9697

9798
```shell
98-
$ julia fit-ace.jl experiment_path TiO2/ \
99-
dataset_path data/ \
100-
trainingset_filename TiO2trainingset.xyz \
101-
testset_filename TiO2testset.xyz \
102-
n_train_sys 80 \
103-
n_test_sys 20 \
104-
n_body 3 \
105-
max_deg 3 \
106-
r0 1.0 \
107-
rcutoff 5.0 \
108-
wL 1.0 \
109-
csp 1.0 \
110-
w_e 1.0 \
111-
w_f 1.0
99+
$ julia --project=../../ fit-ace.jl experiment_path HfB2/ \
100+
dataset_path ../../../data/ \
101+
dataset_filename HfB2-n24-585.exyz \
102+
split_prop 0.8 \
103+
max_train_sys 800 \
104+
max_test_sys 200 \
105+
n_body 3 \
106+
max_deg 3 \
107+
r0 1.0 \
108+
rcutoff 5.0 \
109+
wL 1.0 \
110+
csp 1.0 \
111+
w_e 1.0 \
112+
w_f 1.0
112113
```
113114

114115
In addition, you can run the experiments with the default parameters (the parameters shown above).
115116

116117
```shell
117-
$ julia fit-ace.jl
118+
$ julia --project=../../ fit-ace.jl
118119
```
119120

120121
### Run multiple fitting experiments in serial/parallel using the wrapper to ACE1.jl in InteratomicBasisPotentials.jl
@@ -134,7 +135,7 @@ Modify the file `run-experiments.jl` to specify the parameter ranges needed to g
134135
Run the script:
135136

136137
```shell
137-
$ julia run-experiments.jl
138+
$ julia --project=../../ run-experiments.jl
138139
```
139140

140141
Each experiment is run in a separate process (using `nohup` to facilitate its execution in a cluster).
@@ -148,11 +149,11 @@ After all experiments have been completed, run the following script to gather th
148149
### Run an MD simulation using the wrapper to Molly.jl or NBodySimulator.jl in Atomistic.jl
149150

150151
```shell
151-
$ run-md-ahfo2-ace-nbs.jl
152+
$ julia --project=../../ run-md-ahfo2-ace-nbs.jl
152153
```
153154
or
154155
```shell
155-
$ run-md-ahfo2-ace-molly.jl
156+
$ julia --project=../../ run-md-ahfo2-ace-molly.jl
156157
```
157158
(Note: currently there is a bug in the second script)
158159

@@ -166,21 +167,21 @@ or
166167

167168
Open terminal and download Julia from https://julialang.org/downloads/
168169
```shell
169-
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.3-linux-x86_64.tar.gz
170+
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.0-linux-x86_64.tar.gz
170171
```
171172
Extract file
172173
```shell
173-
$ tar xvzf julia-1.7.3-linux-x86_64.tar.gz
174+
$ tar xvzf julia-1.8.0-linux-x86_64.tar.gz
174175
```
175176
Copy to `/opt` and create link
176177
```shell
177-
$ sudo mv ./julia-1.7.3 /opt/
178-
$ sudo ln -s /opt/julia-1.7.3/bin/julia /usr/local/bin/julia
178+
$ sudo mv ./julia-1.8.0 /opt/
179+
$ sudo ln -s /opt/julia-1.8.0/bin/julia /usr/local/bin/julia
179180
```
180181
Alternative: add line to `.shellrc`
181182
```shell
182183
$ nano .shellrc
183-
PATH=$PATH:/home/youruser/julia-1.7.3 /bin/
184+
PATH=$PATH:/home/youruser/julia-1.8.0 /bin/
184185
```
185186
Restart the terminal
186187

@@ -204,4 +205,4 @@ Activate and instantiate
204205
```julia
205206
pkg> activate .
206207
pkg> instantiate
207-
```
208+
```

workflows/ACE/fit-ace.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using LinearAlgebra
66

77

88
# Load input parameters
9-
args = ["experiment_path", "HfB2-33/",
9+
args = ["experiment_path", "HfB2/",
1010
"dataset_path", "../../../data/",
1111
"dataset_filename", "HfB2-n24-585.exyz",
1212
"split_prop", "0.8", # 80% training, 20% test.

workflows/ACE/run-experiments.jl

+29-30
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Run multiple fitting experiments in serial or parallel.
22
#
33
# 1. Update parameters ranges in run-experiments.jl
4-
# 2. Run: $ julia run-experiments.jl
4+
# 2. Run: $ julia --project=../../ run-experiments.jl
55
# 3. After all experiments have been completed, run the following script to gather
66
# the results into a single csv: $ ./gather-results.sh
77
#
@@ -11,11 +11,10 @@ using IterTools
1111
# Parameter labels
1212
labels = [ "experiment_path",
1313
"dataset_path",
14-
"trainingset_filename",
15-
"testset_filename",
16-
"n_train_sys",
17-
"n_test_sys",
18-
"n_batches",
14+
"dataset_filename",
15+
"split_prop",
16+
"max_train_sys",
17+
"max_test_sys",
1918
"n_body",
2019
"max_deg",
2120
"r0",
@@ -25,9 +24,8 @@ labels = [ "experiment_path",
2524
"w_e",
2625
"w_f"]
2726

28-
2927
# Parallel execution. Warning: a high number of parallel experiments may degrade system performance.
30-
parallel = false
28+
parallel = true
3129

3230
# Experiment folder
3331
experiments_path = "experiments/"
@@ -38,25 +36,27 @@ juliafile = "fit-ace.jl"
3836
# Parameter definitions ########################################################
3937

4038
# dataset path
41-
dataset_path = ["../data/"]
39+
dataset_path = ["../../../data/"]
40+
41+
# dataset filename
42+
dataset_filename = [ "HfB2-n24-585.exyz",
43+
"HfO2_cpmd_1000.xyz",
44+
"HfO2_cpmd_train_0_94_11_7700.xyz",
45+
"HfO2_relax_1000_989.xyz" ]
4246

43-
# datasets filename
44-
trainingset_filename = ["TiO2trainingset.xyz"]
45-
testset_filename = ["TiO2testset.xyz"]
47+
# Split proportoin
48+
split_prop = 0.8:0.8
4649

4750
# number of atomic configurations
48-
#n_systems = 100:100
49-
n_train_sys = 80:80
50-
n_test_sys = 20:20
51+
max_train_sys = 800:800
52+
max_test_sys = 200:200
5153

52-
# number of batches per dataset
53-
n_batches = 8:8
5454

5555
# n_body: body order. N: correlation order (N = n_body - 1)
56-
n_body = 2:5
56+
n_body = 2:2
5757

5858
# max_deg: maximum polynomial degree
59-
max_deg = 3:6
59+
max_deg = 3:3
6060

6161
# r0: An estimate on the nearest-neighbour distance for scaling, JuLIP.rnn()
6262
# function returns element specific earest-neighbour distance
@@ -66,43 +66,42 @@ r0 = 1.0:1.0 # ( rnn(:Hf) + rnn(:O) ) / 2.0 ?
6666
# rin = 0.65*r0 is the default
6767

6868
# rcutoff or rcut: outer cutoff radius
69-
rcutoff = 4.0:7.0
69+
rcutoff = 5.0:5.0
7070

7171
# D: specifies the notion of polynomial degree for which there is no canonical
7272
# definition in the multivariate setting. Here we use SparsePSHDegree which
7373
# specifies a general class of sparse basis sets; see its documentation for
7474
# more details. Default: D = ACE1.SparsePSHDegree(; wL = rpi.wL, csp = rpi.csp)
7575
# wL: ?
76-
wL = 0.5:0.5:1.5
76+
wL = 1.0:1.0
7777
# csp: ?
78-
csp = 0.5:0.5:1.5
78+
csp = 1.0:1.0
7979

8080
# pin: specifies the behaviour of the basis as the inner cutoff radius.
8181
# pin = 0 is the default.
8282

8383
# w_e: energy weight, used during fitting in normal equations
84-
w_e = [1e-8, 1.0, 100.0]
84+
w_e = 1.0:1.0
8585

8686
# w_f: force weight, used during fitting in normal equations
87-
w_f = [1e-8, 1.0, 100.0]
87+
w_f = 1.0:1.0
8888

8989

9090
# Run experiments ##############################################################
9191

92-
run(`mkdir $experiments_path`)
93-
for params in product(dataset_path, trainingset_filename, testset_filename,
94-
n_train_sys, n_test_sys, n_batches,
95-
n_body, max_deg, r0, rcutoff, wL, csp, w_e, w_f)
92+
run(`mkdir -p $experiments_path`)
93+
for params in product( dataset_path, dataset_filename, split_prop, max_train_sys,
94+
max_test_sys, n_body, max_deg, r0, rcutoff, wL, csp, w_e, w_f)
9695
print("Launching experiment with parameters: ")
9796
currexp_path = reduce(*,map(s->"$s"*"-", params[2:end]))[1:end-1]
9897
params = vcat(["$(labels[1])", "$experiments_path$currexp_path/"],
9998
vcat([ ["$l", "$p"] for (l, p) in zip(labels[2:end], params)]...))
10099
println("$params")
101100

102101
if parallel
103-
@async run(Cmd(`nohup julia $juliafile $params`, dir="./"));
102+
@async run(Cmd(`nohup julia --project=../../ $juliafile $params`, dir="./"));
104103
else
105-
run(Cmd(`julia $juliafile $params`, dir="./"));
104+
run(Cmd(`julia --project=../../ $juliafile $params`, dir="./"));
106105
end
107106

108107
println("")

workflows/NeuralACE-experimental/run-experiments.jl

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Run multiple fitting experiments in serial or parallel.
22
#
33
# 1. Update parameters ranges in run-experiments.jl
4-
# 2. Run: $ julia run-experiments.jl
4+
# 2. Run: $ julia --project=../../ run-experiments.jl
55
# 3. After all experiments have been completed, run the following script to gather
66
# the results into a single csv: $ ./gather-results.sh
77
#
@@ -41,10 +41,13 @@ juliafile = "fit-neural-ace.jl"
4141
# Parameter definitions ########################################################
4242

4343
# dataset path
44-
dataset_path = ["../../data/"]
44+
dataset_path = ["../../../data/"]
4545

4646
# dataset filename
47-
dataset_filename = ["HfB2-n24-585.exyz"]
47+
dataset_filename = [ "HfO2_cpmd_1000.xyz",
48+
"HfO2_cpmd_train_0_94_11_7700.xyz",
49+
"HfO2_relax_1000_989.xyz",
50+
"HfB2-n24-585.exyz"]
4851

4952
# Split proportoin
5053
split_prop = 0.8:0.8
@@ -63,7 +66,7 @@ n_batches = 1:1
6366
optimiser = ["BFGS"]
6467

6568
# Max. no. of optimizer iterations
66-
max_it = 70:70
69+
max_it = 100:100
6770

6871
# n_body: body order. N: correlation order (N = n_body - 1)
6972
n_body = 2:2

0 commit comments

Comments
 (0)