File size: 7,745 Bytes
40ff611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
data:
  root_path: ${oc.env:PROJECT_ROOT}/data/mp_20
  prop: formation_energy_per_atom
  num_targets: 1
  properties:
  - formation_energy_per_atom
  conditions:
  - formation_energy_per_atom
  niggli: true
  primitive: false
  graph_method: crystalnn
  lattice_scale_method: scale_length
  preprocess_workers: 30
  readout: mean
  max_atoms: 20
  otf_graph: false
  eval_model_name: mp20
  tolerance: 0.1
  use_space_group: false
  use_pos_index: false
  train_max_epochs: 3000
  early_stopping_patience: 100000
  teacher_forcing_max_epoch: 500
  datamodule:
    _target_: diffcsp.pl_data.datamodule.CrystDataModule
    datasets:
      train:
        _target_: diffcsp.pl_data.dataset.CrystDataset
        name: Formation energy train
        path: ${data.root_path}/train.csv
        save_path: ${data.root_path}/train_ori.pt
        prop: ${data.prop}
        properties: ${data.properties}
        niggli: ${data.niggli}
        primitive: ${data.primitive}
        graph_method: ${data.graph_method}
        tolerance: ${data.tolerance}
        use_space_group: ${data.use_space_group}
        use_pos_index: ${data.use_pos_index}
        lattice_scale_method: ${data.lattice_scale_method}
        preprocess_workers: ${data.preprocess_workers}
      val:
      - _target_: diffcsp.pl_data.dataset.CrystDataset
        name: Formation energy val
        path: ${data.root_path}/val.csv
        save_path: ${data.root_path}/val_ori.pt
        prop: ${data.prop}
        properties: ${data.properties}
        niggli: ${data.niggli}
        primitive: ${data.primitive}
        graph_method: ${data.graph_method}
        tolerance: ${data.tolerance}
        use_space_group: ${data.use_space_group}
        use_pos_index: ${data.use_pos_index}
        lattice_scale_method: ${data.lattice_scale_method}
        preprocess_workers: ${data.preprocess_workers}
      test:
      - _target_: diffcsp.pl_data.dataset.CrystDataset
        name: Formation energy test
        path: ${data.root_path}/test.csv
        save_path: ${data.root_path}/test_ori.pt
        prop: ${data.prop}
        properties: ${data.properties}
        niggli: ${data.niggli}
        primitive: ${data.primitive}
        graph_method: ${data.graph_method}
        tolerance: ${data.tolerance}
        use_space_group: ${data.use_space_group}
        use_pos_index: ${data.use_pos_index}
        lattice_scale_method: ${data.lattice_scale_method}
        preprocess_workers: ${data.preprocess_workers}
    num_workers:
      train: 0
      val: 0
      test: 0
    batch_size:
      train: 256
      val: 128
      test: 128
logging:
  val_check_interval: 1
  progress_bar_refresh_rate: 10
  wandb:
    name: ${expname}
    project: crystalflow-gridtest
    entity: null
    log_model: true
    mode: online
    group: ${expname}
  wandb_watch:
    log: all
    log_freq: 500
  lr_monitor:
    logging_interval: step
    log_momentum: false
model:
  decoder:
    _target_: diffcsp.pl_modules.cspnet.CSPNet
    hidden_dim: 512
    latent_dim: 0
    lattice_dim: 6
    max_atoms: 100
    num_layers: 6
    act_fn: silu
    dis_emb: sin
    num_freqs: 256
    rec_emb: sin
    num_millers: 8
    edge_style: fc
    max_neighbors: ${model.max_neighbors}
    cutoff: ${model.radius}
    ln: true
    ip: false
    pred_type: true
    smooth: ${model.decoder.pred_type}
    na_emb: 0
  beta_scheduler:
    _target_: diffcsp.pl_modules.diff_utils.BetaScheduler
    timesteps: ${model.timesteps}
    scheduler_mode: cosine
  sigma_scheduler:
    _target_: diffcsp.pl_modules.diff_utils.SigmaScheduler
    timesteps: ${model.timesteps}
    sigma_begin: 0.005
    sigma_end: 0.5
  conditions:
    cond_keys: ${data.conditions}
    types:
      e_above_hull:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: e_above_hull
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      energy_per_atom:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: energy_per_atom
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      enthalpy_per_atom:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: enthalpy_per_atom
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      energy:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: energy
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      enthalpy:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: enthalpy
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      formation_energy_per_atom:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: formation_energy_per_atom
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      pressure:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: pressure
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -2
        stop: 2
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
      spgno:
        _target_: diffcsp.pl_modules.conditioning.ScalarEmbedding
        prop_name: spgno
        batch_norm: false
        no_expansion: false
        n_basis: 50
        start: -1
        stop: 1
        trainable_gaussians: false
        no_mlp: true
        hidden_dim: 128
        fc_num_layers: 5
        n_out: 128
  _target_: diffcsp.pl_modules.flow.CSPFlow
  time_dim: 256
  latent_dim: 0
  cost_type: 10
  cost_coord: 10
  cost_lattice: 1
  max_neighbors: 20
  radius: 7.0
  timesteps: 1000
  lattice_polar: true
  type_encoding: table
  lattice_polar_sigma: 0.1
optim:
  optimizer:
    _target_: torch.optim.Adam
    lr: 0.001
    betas:
    - 0.9
    - 0.999
    eps: 1.0e-08
    weight_decay: 0
  use_lr_scheduler: true
  lr_scheduler:
    _target_: torch.optim.lr_scheduler.ReduceLROnPlateau
    factor: 0.6
    patience: 30
    min_lr: 0.0001
train:
  deterministic: true
  random_seed: 42
  float32_matmul_precision: medium
  pl_trainer:
    fast_dev_run: false
    devices: 4
    accelerator: gpu
    precision: 32
    max_epochs: ${data.train_max_epochs}
    accumulate_grad_batches: 1
    num_sanity_val_steps: 2
    gradient_clip_val: 0.5
    gradient_clip_algorithm: value
    strategy: ddp_find_unused_parameters_true
  monitor_metric: val_loss
  monitor_metric_mode: min
  early_stopping:
    patience: ${data.early_stopping_patience}
    verbose: false
  model_checkpoints:
    save_top_k: 1
    verbose: false
    save_last: false
expname: abinit-BS1-LR1-WD1-RF1-K3-LW2-F1-X2-TE4-N1-H1-L1
core:
  version: 0.0.1
  tags:
  - ${now:%Y-%m-%d}