akore commited on
Commit
d7fb745
1 Parent(s): 9b019ec

Upload 2 files

Browse files
Files changed (2) hide show
  1. configuration_atomformer.py +42 -0
  2. modeling_atomformer.py +2867 -0
configuration_atomformer.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers.configuration_utils import PretrainedConfig
2
+ from typing import Any
3
+
4
+ class AtomformerConfig(PretrainedConfig): # type: ignore
5
+ r"""
6
+ Configuration of a :class:`~transform:class:`~transformers.AtomformerModel`.
7
+
8
+ It is used to instantiate an Atomformer model according to the specified arguments.
9
+ """
10
+
11
+ model_type = "atomformer"
12
+
13
+ def __init__(
14
+ self,
15
+ vocab_size: int = 123,
16
+ dim: int = 768,
17
+ num_heads: int = 32,
18
+ depth: int = 12,
19
+ mlp_ratio: int = 1,
20
+ k: int = 128,
21
+ dropout: float = 0.0,
22
+ mask_token_id: int = 0,
23
+ pad_token_id: int = 119,
24
+ bos_token_id: int = 120,
25
+ eos_token_id: int = 121,
26
+ cls_token_id: int = 122,
27
+ **kwargs: Any,
28
+ ) -> None:
29
+ super().__init__(**kwargs)
30
+ self.vocab_size = vocab_size
31
+ self.dim = dim
32
+ self.num_heads = num_heads
33
+ self.depth = depth
34
+ self.mlp_ratio = mlp_ratio
35
+ self.k = k
36
+
37
+ self.dropout = dropout
38
+ self.mask_token_id = mask_token_id
39
+ self.pad_token_id = pad_token_id
40
+ self.bos_token_id = bos_token_id
41
+ self.eos_token_id = eos_token_id
42
+ self.cls_token_id = cls_token_id
modeling_atomformer.py ADDED
@@ -0,0 +1,2867 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Implementation of the Uni-mol+ model with alterations to the original model."""
2
+
3
+ from typing import Any, Optional, Tuple
4
+
5
+ import torch
6
+ import torch.nn.functional as f
7
+ from torch import nn
8
+ from transformers.modeling_utils import PreTrainedModel
9
+ from .configuration_atomformer import AtomformerConfig
10
+
11
+
12
+ ATOM_METADATA = [
13
+ [
14
+ 0.0,
15
+ 0.0,
16
+ 0.0,
17
+ 0.0,
18
+ 0.0,
19
+ 0.0,
20
+ 0.0,
21
+ 0.106761565836299,
22
+ 0.4573170731707318,
23
+ 0.46896368424867707,
24
+ 0.0,
25
+ 0.0,
26
+ 0.0027383806383189145,
27
+ 0.0,
28
+ 1.0,
29
+ 0.0,
30
+ 0.0,
31
+ ],
32
+ [
33
+ 0.008547008547008548,
34
+ 0.010187317385107808,
35
+ 0.011235955056179775,
36
+ 0.008547008547008548,
37
+ 0.008547008547008548,
38
+ 0.0,
39
+ 1.0,
40
+ 0.0,
41
+ -1.0,
42
+ 0.9999999999999999,
43
+ 2.1731754967921256e-06,
44
+ -1.0,
45
+ 0.0,
46
+ 0.010000000000000002,
47
+ 0.3588318085855031,
48
+ 0.0,
49
+ -1.0,
50
+ ],
51
+ [
52
+ 0.017094017094017096,
53
+ 0.02018415404448405,
54
+ 0.02247191011235955,
55
+ 0.017094017094017096,
56
+ 0.017094017094017096,
57
+ 0.16666666666666666,
58
+ 0.0,
59
+ 0.5729537366548044,
60
+ 0.08536585365853658,
61
+ 0.0723802160098582,
62
+ 0.01302222611458848,
63
+ 0.1117635470484688,
64
+ 0.2746530986669577,
65
+ 0.010000000000000002,
66
+ 0.2454609429978888,
67
+ 0.16666666666666666,
68
+ 0.0,
69
+ ],
70
+ [
71
+ 0.025641025641025644,
72
+ 0.027228539455021038,
73
+ 0.028089887640449437,
74
+ 0.025641025641025644,
75
+ 0.025641025641025644,
76
+ 0.16666666666666666,
77
+ 0.058823529411764705,
78
+ 0.32384341637010683,
79
+ 0.2652439024390244,
80
+ 0.2623432478797689,
81
+ 0.0451198574701265,
82
+ 0.39298038243761085,
83
+ 0.4668171696125004,
84
+ 0.015,
85
+ 0.12181562280084446,
86
+ 0.16666666666666666,
87
+ 0.14285714285714285,
88
+ ],
89
+ [
90
+ 0.03418803418803419,
91
+ 0.03334773276914757,
92
+ 0.033707865168539325,
93
+ 0.03418803418803419,
94
+ 0.03418803418803419,
95
+ 0.16666666666666666,
96
+ 0.7058823529411764,
97
+ 0.25266903914590755,
98
+ 0.4085365853658537,
99
+ 0.2128252833015198,
100
+ 0.057071103187614054,
101
+ 0.6504807478441018,
102
+ 0.715419845245687,
103
+ 0.015,
104
+ 0.06558761435608726,
105
+ 0.16666666666666666,
106
+ 0.2857142857142857,
107
+ ],
108
+ [
109
+ 0.042735042735042736,
110
+ 0.03742946260625253,
111
+ 0.033707865168539325,
112
+ 0.042735042735042736,
113
+ 0.042735042735042736,
114
+ 0.16666666666666666,
115
+ 0.7647058823529411,
116
+ 0.14946619217081855,
117
+ 0.5640243902439024,
118
+ 0.3559765143644139,
119
+ 0.055363782370830124,
120
+ 1.0000000000000002,
121
+ 0.7324707832177849,
122
+ 0.020000000000000004,
123
+ 0.04327938071780436,
124
+ 0.16666666666666666,
125
+ 0.42857142857142855,
126
+ ],
127
+ [
128
+ 0.051282051282051294,
129
+ 0.04421873990197045,
130
+ 0.03932584269662921,
131
+ 0.051282051282051294,
132
+ 0.051282051282051294,
133
+ 0.16666666666666666,
134
+ 0.8235294117647058,
135
+ 0.09252669039145908,
136
+ 0.7134146341463414,
137
+ 0.514180781404789,
138
+ 2.8295183993586364e-05,
139
+ 0.012484827687008686,
140
+ 0.012471056032792366,
141
+ 0.025,
142
+ 0.06657283603096412,
143
+ 0.16666666666666666,
144
+ 0.5714285714285714,
145
+ ],
146
+ [
147
+ 0.05982905982905984,
148
+ 0.050994411431564704,
149
+ 0.0449438202247191,
150
+ 0.05982905982905984,
151
+ 0.05982905982905984,
152
+ 0.16666666666666666,
153
+ 0.8823529411764706,
154
+ 0.05693950177935947,
155
+ 0.8353658536585367,
156
+ 0.4699156740039142,
157
+ 3.268543752245935e-05,
158
+ 0.00923366315240946,
159
+ 0.014660396468409729,
160
+ 0.025,
161
+ 0.057987332864180154,
162
+ 0.16666666666666666,
163
+ 0.7142857142857142,
164
+ ],
165
+ [
166
+ 0.06837606837606838,
167
+ 0.06119533458279619,
168
+ 0.056179775280898875,
169
+ 0.06837606837606838,
170
+ 0.06837606837606838,
171
+ 0.16666666666666666,
172
+ 0.9411764705882353,
173
+ 0.028469750889679707,
174
+ 1.0,
175
+ 0.6537753400826345,
176
+ 3.9270817815768815e-05,
177
+ 0.01002929606822616,
178
+ 0.01377886297525227,
179
+ 0.015,
180
+ 0.051372273047149884,
181
+ 0.16666666666666666,
182
+ 0.8571428571428572,
183
+ ],
184
+ [
185
+ 0.07692307692307693,
186
+ 0.06521583847234458,
187
+ 0.056179775280898875,
188
+ 0.07692307692307693,
189
+ 0.07692307692307693,
190
+ 0.16666666666666666,
191
+ 1.0,
192
+ 0.007117437722419961,
193
+ -1.0,
194
+ 0.8539203131418077,
195
+ 1.9758579909666677e-05,
196
+ 0.002676173590325307,
197
+ 0.003896139326624358,
198
+ 0.025,
199
+ 0.06586910626319493,
200
+ 0.16666666666666666,
201
+ 1.0,
202
+ ],
203
+ [
204
+ 0.08547008547008549,
205
+ 0.07477388917423204,
206
+ 0.06741573033707865,
207
+ 0.08547008547008549,
208
+ 0.08547008547008549,
209
+ 0.33333333333333337,
210
+ 0.0,
211
+ 0.6085409252669042,
212
+ 0.07012195121951223,
213
+ 0.06017348442747725,
214
+ 0.023680786070796774,
215
+ 0.09074155275516495,
216
+ 0.19638929337502856,
217
+ 0.020000000000000004,
218
+ 0.07980295566502463,
219
+ 0.33333333333333337,
220
+ 0.0,
221
+ ],
222
+ [
223
+ 0.09401709401709403,
224
+ 0.0792467847873929,
225
+ 0.06741573033707865,
226
+ 0.09401709401709403,
227
+ 0.09401709401709403,
228
+ 0.33333333333333337,
229
+ 0.058823529411764705,
230
+ 0.43060498220640586,
231
+ 0.1859756097560976,
232
+ 0.18132746997849566,
233
+ 0.04243692475803745,
234
+ 0.23105764525702377,
235
+ 0.2316847349772711,
236
+ 0.025,
237
+ 0.0653764954257565,
238
+ 0.33333333333333337,
239
+ 0.14285714285714285,
240
+ ],
241
+ [
242
+ 0.10256410256410257,
243
+ 0.08835244376566789,
244
+ 0.07865168539325842,
245
+ 0.10256410256410257,
246
+ 0.10256410256410257,
247
+ 0.33333333333333337,
248
+ 0.7058823529411764,
249
+ 0.4661921708185055,
250
+ 0.2774390243902439,
251
+ 0.10108971416145165,
252
+ 0.06585161024536003,
253
+ 0.23366315240945865,
254
+ 0.4753426385985493,
255
+ 0.025,
256
+ 0.05650950035186488,
257
+ 0.33333333333333337,
258
+ 0.2857142857142857,
259
+ ],
260
+ [
261
+ 0.11111111111111113,
262
+ 0.09210763521580445,
263
+ 0.07865168539325842,
264
+ 0.11111111111111113,
265
+ 0.11111111111111113,
266
+ 0.33333333333333337,
267
+ 0.7647058823529411,
268
+ 0.35943060498220647,
269
+ 0.36585365853658536,
270
+ 0.20575543044917485,
271
+ 0.05682720021378778,
272
+ 0.4242464682668294,
273
+ 0.6025426358703994,
274
+ 0.025,
275
+ 0.04299788881069668,
276
+ 0.33333333333333337,
277
+ 0.42857142857142855,
278
+ ],
279
+ [
280
+ 0.11965811965811968,
281
+ 0.10193099835710374,
282
+ 0.0898876404494382,
283
+ 0.11965811965811968,
284
+ 0.11965811965811968,
285
+ 0.33333333333333337,
286
+ 0.8235294117647058,
287
+ 0.25266903914590755,
288
+ 0.4542682926829268,
289
+ 0.3185927948389591,
290
+ 0.04438814854864767,
291
+ 0.07704039807065373,
292
+ 0.09357213740327856,
293
+ 0.020000000000000004,
294
+ 0.04750175932441942,
295
+ 0.33333333333333337,
296
+ 0.5714285714285714,
297
+ ],
298
+ [
299
+ 0.12820512820512822,
300
+ 0.10564197106733833,
301
+ 0.0898876404494382,
302
+ 0.12820512820512822,
303
+ 0.12820512820512822,
304
+ 0.33333333333333337,
305
+ 0.8823529411764706,
306
+ 0.21708185053380794,
307
+ 0.5731707317073171,
308
+ 0.31247009930654546,
309
+ 0.05048572289430458,
310
+ 0.09515439218602051,
311
+ 0.1216720831812958,
312
+ 0.035,
313
+ 0.04334975369458127,
314
+ 0.33333333333333337,
315
+ 0.7142857142857142,
316
+ ],
317
+ [
318
+ 0.13675213675213677,
319
+ 0.11716605497409803,
320
+ 0.10112359550561797,
321
+ 0.13675213675213677,
322
+ 0.13675213675213677,
323
+ 0.33333333333333337,
324
+ 0.9411764705882353,
325
+ 0.17081850533807832,
326
+ 0.75,
327
+ 0.43848068233986515,
328
+ 7.610016686353661e-05,
329
+ 0.04019725595612581,
330
+ 0.040050948202660634,
331
+ 0.04,
332
+ 0.0270935960591133,
333
+ 0.33333333333333337,
334
+ 0.8571428571428572,
335
+ ],
336
+ [
337
+ 0.1452991452991453,
338
+ 0.13245553465558702,
339
+ 0.12359550561797752,
340
+ 0.1452991452991453,
341
+ 0.1452991452991453,
342
+ 0.33333333333333337,
343
+ 1.0,
344
+ 0.13879003558718864,
345
+ -1.0,
346
+ 0.573402276077029,
347
+ 4.1222041606379033e-05,
348
+ 0.0177390552812359,
349
+ 0.01416591926721889,
350
+ 0.025,
351
+ 0.029978888106966927,
352
+ 0.33333333333333337,
353
+ 1.0,
354
+ ],
355
+ [
356
+ 0.15384615384615385,
357
+ 0.12956430935430432,
358
+ 0.11235955056179775,
359
+ 0.15384615384615385,
360
+ 0.15384615384615385,
361
+ 0.5,
362
+ 0.0,
363
+ 0.8220640569395019,
364
+ 0.036585365853658514,
365
+ 0.021591320946190845,
366
+ 0.02102224365609036,
367
+ 0.08193366760083631,
368
+ 0.17524613028962724,
369
+ 0.035,
370
+ 0.04665728360309641,
371
+ 0.5,
372
+ 0.0,
373
+ ],
374
+ [
375
+ 0.1623931623931624,
376
+ 0.13289772205460673,
377
+ 0.11235955056179775,
378
+ 0.1623931623931624,
379
+ 0.1623931623931624,
380
+ 0.5,
381
+ 0.058823529411764705,
382
+ 0.6085409252669042,
383
+ 0.09146341463414634,
384
+ 0.10724623674100561,
385
+ 0.03755886528151192,
386
+ 0.27910065518972543,
387
+ 0.2988654305873366,
388
+ 0.05500000000000001,
389
+ 0.038916256157635463,
390
+ 0.5,
391
+ 0.14285714285714285,
392
+ ],
393
+ [
394
+ 0.17094017094017097,
395
+ 0.14948995384243843,
396
+ 0.1348314606741573,
397
+ 0.17094017094017097,
398
+ 0.17094017094017097,
399
+ 0.5,
400
+ 0.1176470588235294,
401
+ 0.5729537366548044,
402
+ 0.201219512195122,
403
+ 0.128910044216783,
404
+ 0.07292479648632205,
405
+ 0.4570377290145464,
406
+ 0.5293941119700996,
407
+ 0.06,
408
+ 0.03335679099225897,
409
+ 0.5,
410
+ -1.0,
411
+ ],
412
+ [
413
+ 0.17948717948717952,
414
+ 0.15939155013894887,
415
+ 0.14606741573033707,
416
+ 0.17948717948717952,
417
+ 0.17948717948717952,
418
+ 0.5,
419
+ 0.1764705882352941,
420
+ 0.5373665480427048,
421
+ 0.25609756097560976,
422
+ 0.14179331674197213,
423
+ 0.11072975742939495,
424
+ 0.48779542320426544,
425
+ 0.6062938422242609,
426
+ 0.03,
427
+ 0.03019000703729768,
428
+ 0.5,
429
+ -1.0,
430
+ ],
431
+ [
432
+ 0.18803418803418806,
433
+ 0.16985098284653036,
434
+ 0.15730337078651685,
435
+ 0.18803418803418806,
436
+ 0.18803418803418806,
437
+ 0.5,
438
+ 0.23529411764705882,
439
+ 0.5017793594306051,
440
+ 0.2835365853658536,
441
+ 0.13783555222654456,
442
+ 0.14902252432012042,
443
+ 0.5493108115837035,
444
+ 0.6267549677907782,
445
+ 0.03,
446
+ 0.027797325826882473,
447
+ 0.5,
448
+ -1.0,
449
+ ],
450
+ [
451
+ 0.1965811965811966,
452
+ 0.17343610222012087,
453
+ 0.15730337078651685,
454
+ 0.1965811965811966,
455
+ 0.1965811965811966,
456
+ 0.5,
457
+ 0.2941176470588235,
458
+ 0.5017793594306051,
459
+ 0.29268292682926833,
460
+ 0.13881653659361634,
461
+ 0.1743884335980532,
462
+ 0.5378719996949651,
463
+ 0.5012600643161381,
464
+ 0.03,
465
+ 0.024982406755805767,
466
+ 0.5,
467
+ -1.0,
468
+ ],
469
+ [
470
+ 0.20512820512820515,
471
+ 0.1834431432040899,
472
+ 0.16853932584269662,
473
+ 0.20512820512820515,
474
+ 0.20512820512820515,
475
+ 0.5,
476
+ 0.3529411764705882,
477
+ 0.4661921708185055,
478
+ 0.25914634146341464,
479
+ 0.17107304225964678,
480
+ 0.1814616198390152,
481
+ 0.38255835382787134,
482
+ 0.3972493426863412,
483
+ 0.04,
484
+ 0.0270935960591133,
485
+ 0.5,
486
+ -1.0,
487
+ ],
488
+ [
489
+ 0.2136752136752137,
490
+ 0.18652825067263504,
491
+ 0.16853932584269662,
492
+ 0.2136752136752137,
493
+ 0.2136752136752137,
494
+ 0.5,
495
+ 0.4117647058823529,
496
+ 0.43060498220640586,
497
+ 0.3445121951219513,
498
+ 0.19370816923188441,
499
+ 0.1919494477135451,
500
+ 0.4560209457355474,
501
+ 0.5336568464631241,
502
+ 0.035,
503
+ 0.024982406755805767,
504
+ 0.5,
505
+ -1.0,
506
+ ],
507
+ [
508
+ 0.22222222222222224,
509
+ 0.19703190212011848,
510
+ 0.1797752808988764,
511
+ 0.22222222222222224,
512
+ 0.22222222222222224,
513
+ 0.5,
514
+ 0.47058823529411764,
515
+ 0.43060498220640586,
516
+ 0.3597560975609756,
517
+ 0.19267402807644915,
518
+ 0.2160958421223465,
519
+ 0.4458531129455577,
520
+ 0.5449104655247086,
521
+ 0.05500000000000001,
522
+ 0.023011963406052074,
523
+ 0.5,
524
+ -1.0,
525
+ ],
526
+ [
527
+ 0.2307692307692308,
528
+ 0.19621555615269748,
529
+ 0.1741573033707865,
530
+ 0.2307692307692308,
531
+ 0.2307692307692308,
532
+ 0.5,
533
+ 0.5294117647058824,
534
+ 0.3950177935943062,
535
+ 0.36890243902439024,
536
+ 0.18101819411892625,
537
+ 0.2173153569914779,
538
+ 0.4351768885160684,
539
+ 0.5425233342086149,
540
+ 0.04,
541
+ 0.024630541871921183,
542
+ 0.5,
543
+ -1.0,
544
+ ],
545
+ [
546
+ 0.23931623931623935,
547
+ 0.21272275190225615,
548
+ 0.19662921348314605,
549
+ 0.23931623931623935,
550
+ 0.23931623931623935,
551
+ 0.5,
552
+ 0.5882352941176471,
553
+ 0.3950177935943062,
554
+ 0.36585365853658536,
555
+ 0.1852030830937251,
556
+ 0.2185348718606093,
557
+ 0.3415311485202626,
558
+ 0.4826745419265514,
559
+ 0.04,
560
+ 0.02047853624208304,
561
+ 0.5,
562
+ -1.0,
563
+ ],
564
+ [
565
+ 0.2478632478632479,
566
+ 0.2189609956699649,
567
+ 0.19662921348314605,
568
+ 0.2478632478632479,
569
+ 0.2478632478632479,
570
+ 0.5,
571
+ 0.6470588235294117,
572
+ 0.35943060498220647,
573
+ 0.28963414634146345,
574
+ 0.2657984391233962,
575
+ 0.17390062765040062,
576
+ 0.17252397384325016,
577
+ 0.20048151848833204,
578
+ 0.06,
579
+ 0.020689655172413793,
580
+ 0.5,
581
+ -1.0,
582
+ ],
583
+ [
584
+ 0.2564102564102564,
585
+ 0.23373345623875397,
586
+ 0.2191011235955056,
587
+ 0.2564102564102564,
588
+ 0.2564102564102564,
589
+ 0.5,
590
+ 0.7058823529411764,
591
+ 0.4661921708185055,
592
+ 0.33841463414634154,
593
+ 0.10174209292773093,
594
+ 0.14414446484359486,
595
+ 0.0733952300154424,
596
+ 0.4216321839864411,
597
+ 0.05500000000000001,
598
+ 0.019493314567206193,
599
+ 0.5,
600
+ 0.2857142857142857,
601
+ ],
602
+ [
603
+ 0.26495726495726496,
604
+ 0.24365546118444995,
605
+ 0.2303370786516854,
606
+ 0.26495726495726496,
607
+ 0.26495726495726496,
608
+ 0.5,
609
+ 0.7647058823529411,
610
+ 0.35943060498220647,
611
+ 0.39939024390243894,
612
+ 0.19356319617271125,
613
+ 0.12975418938784455,
614
+ 0.30434230009087504,
615
+ 0.5288825838309366,
616
+ 0.07,
617
+ 0.015904292751583393,
618
+ 0.5,
619
+ 0.42857142857142855,
620
+ ],
621
+ [
622
+ 0.27350427350427353,
623
+ 0.2514175507580112,
624
+ 0.23595505617977527,
625
+ 0.27350427350427353,
626
+ 0.27350427350427353,
627
+ 0.5,
628
+ 0.8235294117647058,
629
+ 0.2882562277580072,
630
+ 0.451219512195122,
631
+ 0.28485756396936235,
632
+ 0.1409737261838533,
633
+ 0.2735083471552311,
634
+ 0.15052227023008535,
635
+ 0.05500000000000001,
636
+ 0.016537649542575653,
637
+ 0.5,
638
+ 0.5714285714285714,
639
+ ],
640
+ [
641
+ 0.28205128205128205,
642
+ 0.2651525716598694,
643
+ 0.25280898876404495,
644
+ 0.28205128205128205,
645
+ 0.28205128205128205,
646
+ 0.5,
647
+ 0.8823529411764706,
648
+ 0.25266903914590755,
649
+ 0.5640243902439024,
650
+ 0.2831082223886727,
651
+ 0.11731513772270441,
652
+ 0.12200763858438347,
653
+ 0.1626284361902748,
654
+ 0.085,
655
+ 0.01597466572836031,
656
+ 0.5,
657
+ 0.7142857142857142,
658
+ ],
659
+ [
660
+ 0.2905982905982906,
661
+ 0.2683635324650587,
662
+ 0.25280898876404495,
663
+ 0.2905982905982906,
664
+ 0.2905982905982906,
665
+ 0.5,
666
+ 0.9411764705882353,
667
+ 0.21708185053380794,
668
+ 0.6890243902439025,
669
+ 0.38272404378186387,
670
+ 0.07609553514606364,
671
+ 0.06402557209946683,
672
+ 0.055889564484942325,
673
+ 0.08,
674
+ 0.026741731175228708,
675
+ 0.5,
676
+ 0.8571428571428572,
677
+ ],
678
+ [
679
+ 0.29914529914529914,
680
+ 0.2816087457864643,
681
+ 0.2696629213483146,
682
+ 0.29914529914529914,
683
+ 0.29914529914529914,
684
+ 0.5,
685
+ 1.0,
686
+ 0.18149466192170824,
687
+ -1.0,
688
+ 0.48835141469543564,
689
+ 8.878312150250298e-05,
690
+ 0.025865695638635226,
691
+ 0.019729640327514418,
692
+ 0.1,
693
+ 0.010837438423645322,
694
+ 0.5,
695
+ 1.0,
696
+ ],
697
+ [
698
+ 0.3076923076923077,
699
+ 0.28728915314310205,
700
+ 0.2696629213483146,
701
+ 0.3076923076923077,
702
+ 0.3076923076923077,
703
+ 0.6666666666666666,
704
+ 0.0,
705
+ 0.8932384341637012,
706
+ 0.036585365853658514,
707
+ 0.013685456785947292,
708
+ 0.03731496230768564,
709
+ 0.07590668471456988,
710
+ 0.16313996432943775,
711
+ 0.085,
712
+ 0.01893033075299085,
713
+ 0.6666666666666666,
714
+ 0.0,
715
+ ],
716
+ [
717
+ 0.3162393162393162,
718
+ 0.2946090553176436,
719
+ 0.2808988764044944,
720
+ 0.3162393162393162,
721
+ 0.3162393162393162,
722
+ 0.6666666666666666,
723
+ 0.058823529411764705,
724
+ 0.7153024911032031,
725
+ 0.07621951219512194,
726
+ 0.08703215985695992,
727
+ 0.06438819240240236,
728
+ 0.26130694780724334,
729
+ 0.2814734738557968,
730
+ 0.075,
731
+ 0.014567206192821956,
732
+ 0.6666666666666666,
733
+ 0.14285714285714285,
734
+ ],
735
+ [
736
+ 0.3247863247863248,
737
+ 0.29898330912640775,
738
+ 0.2808988764044944,
739
+ 0.3247863247863248,
740
+ 0.3247863247863248,
741
+ 0.6666666666666666,
742
+ 0.1176470588235294,
743
+ 0.6441281138790037,
744
+ 0.15853658536585366,
745
+ 0.11227680189431463,
746
+ 0.109022436612611,
747
+ 0.4537331833577997,
748
+ 0.6146488018305888,
749
+ 0.09,
750
+ 0.014356087262491202,
751
+ 0.6666666666666666,
752
+ -1.0,
753
+ ],
754
+ [
755
+ 0.3333333333333333,
756
+ 0.3068678505950822,
757
+ 0.28651685393258425,
758
+ 0.3333333333333333,
759
+ 0.3333333333333333,
760
+ 0.6666666666666666,
761
+ 0.1764705882352941,
762
+ 0.6085409252669042,
763
+ 0.19207317073170735,
764
+ 0.1324087273781622,
765
+ 0.15877864327317145,
766
+ 0.5366010205962164,
767
+ 0.7976053662711987,
768
+ 0.085,
769
+ 0.012948627726952853,
770
+ 0.6666666666666666,
771
+ -1.0,
772
+ ],
773
+ [
774
+ 0.3418803418803419,
775
+ 0.312589075250091,
776
+ 0.29213483146067415,
777
+ 0.3418803418803419,
778
+ 0.3418803418803419,
779
+ 0.6666666666666666,
780
+ 0.23529411764705882,
781
+ 0.5729537366548044,
782
+ 0.27439024390243905,
783
+ 0.13844927151037764,
784
+ 0.2090226558813845,
785
+ 0.6931856455620589,
786
+ 0.8547260084777264,
787
+ 0.105,
788
+ 0.012033779028852921,
789
+ 0.6666666666666666,
790
+ -1.0,
791
+ ],
792
+ [
793
+ 0.35042735042735046,
794
+ 0.3229770776855231,
795
+ 0.3033707865168539,
796
+ 0.35042735042735046,
797
+ 0.35042735042735046,
798
+ 0.6666666666666666,
799
+ 0.2941176470588235,
800
+ 0.5373665480427048,
801
+ 0.44512195121951226,
802
+ 0.15456544325512842,
803
+ 0.24877884061506758,
804
+ 0.7310608227047707,
805
+ 0.8368225236070237,
806
+ 0.085,
807
+ 0.011048557353976075,
808
+ 0.6666666666666666,
809
+ -1.0,
810
+ ],
811
+ [
812
+ 0.358974358974359,
813
+ 0.3299160184086015,
814
+ 0.3089887640449438,
815
+ 0.358974358974359,
816
+ 0.358974358974359,
817
+ 0.6666666666666666,
818
+ 0.3529411764705882,
819
+ 0.5373665480427048,
820
+ 0.36585365853658536,
821
+ 0.16363109188875738,
822
+ 0.28048622721248356,
823
+ 0.6250611658691273,
824
+ 0.8774037559806166,
825
+ 0.1,
826
+ -1.0,
827
+ 0.6666666666666666,
828
+ -1.0,
829
+ ],
830
+ [
831
+ 0.36752136752136755,
832
+ 0.3403584439085284,
833
+ 0.3202247191011236,
834
+ 0.36752136752136755,
835
+ 0.36752136752136755,
836
+ 0.6666666666666666,
837
+ 0.4117647058823529,
838
+ 0.5017793594306051,
839
+ 0.4573170731707318,
840
+ 0.16752120230990405,
841
+ 0.30243749485684845,
842
+ 0.6377709568566146,
843
+ 0.7534434369234653,
844
+ 0.065,
845
+ 0.010133708655876143,
846
+ 0.6666666666666666,
847
+ -1.0,
848
+ ],
849
+ [
850
+ 0.37606837606837606,
851
+ 0.346603490559299,
852
+ 0.3258426966292135,
853
+ 0.37606837606837606,
854
+ 0.37606837606837606,
855
+ 0.6666666666666666,
856
+ 0.47058823529411764,
857
+ 0.4661921708185055,
858
+ 0.4817073170731707,
859
+ 0.17227631865078405,
860
+ 0.30243749485684845,
861
+ 0.5655793440476872,
862
+ 0.67586166915042,
863
+ 0.085,
864
+ 0.01048557353976073,
865
+ 0.6666666666666666,
866
+ -1.0,
867
+ ],
868
+ [
869
+ 0.38461538461538464,
870
+ 0.35855615609895475,
871
+ 0.33707865168539325,
872
+ 0.38461538461538464,
873
+ 0.38461538461538464,
874
+ 0.6666666666666666,
875
+ 0.5294117647058824,
876
+ 0.4661921708185055,
877
+ 0.4573170731707318,
878
+ 0.21470510063546525,
879
+ 0.2926813759037974,
880
+ 0.4603422746712931,
881
+ 0.5510488031946638,
882
+ 0.09,
883
+ 0.01055594651653765,
884
+ 0.6666666666666666,
885
+ -1.0,
886
+ ],
887
+ [
888
+ 0.39316239316239315,
889
+ 0.363481443435728,
890
+ 0.34269662921348315,
891
+ 0.39316239316239315,
892
+ 0.39316239316239315,
893
+ 0.6666666666666666,
894
+ 0.5882352941176471,
895
+ 0.4661921708185055,
896
+ 0.375,
897
+ 0.17794476526445505,
898
+ 0.25609592982985585,
899
+ 0.31011254519919423,
900
+ 0.41447079003816,
901
+ 0.12000000000000001,
902
+ 0.00992258972554539,
903
+ 0.6666666666666666,
904
+ -1.0,
905
+ ],
906
+ [
907
+ 0.4017094017094017,
908
+ 0.37893419231070125,
909
+ 0.3595505617977528,
910
+ 0.4017094017094017,
911
+ 0.4017094017094017,
912
+ 0.6666666666666666,
913
+ 0.6470588235294117,
914
+ 0.43060498220640586,
915
+ 0.301829268292683,
916
+ 0.24644936815908378,
917
+ 0.21194949156729978,
918
+ 0.1474729758069129,
919
+ 0.17661020532739505,
920
+ 0.095,
921
+ 0.00971147079521464,
922
+ 0.6666666666666666,
923
+ -1.0,
924
+ ],
925
+ [
926
+ 0.4102564102564103,
927
+ 0.38712146207562764,
928
+ 0.3707865168539326,
929
+ 0.4102564102564103,
930
+ 0.4102564102564103,
931
+ 0.6666666666666666,
932
+ 0.7058823529411764,
933
+ 0.5373665480427048,
934
+ 0.3292682926829269,
935
+ 0.09145383816174166,
936
+ 0.1782908811792736,
937
+ 0.10567809912365993,
938
+ 0.39912494586327196,
939
+ 0.15500000000000003,
940
+ 0.009781843771991556,
941
+ 0.6666666666666666,
942
+ 0.2857142857142857,
943
+ ],
944
+ [
945
+ 0.4188034188034188,
946
+ 0.40035987251397137,
947
+ 0.38764044943820225,
948
+ 0.4188034188034188,
949
+ 0.4188034188034188,
950
+ 0.6666666666666666,
951
+ 0.7647058823529411,
952
+ 0.43060498220640586,
953
+ 0.38414634146341464,
954
+ 0.16671901804914588,
955
+ 0.17780307523162106,
956
+ 0.12481904435081566,
957
+ 0.4894949171153905,
958
+ 0.125,
959
+ 0.009429978888106968,
960
+ 0.6666666666666666,
961
+ 0.42857142857142855,
962
+ ],
963
+ [
964
+ 0.4273504273504274,
965
+ 0.4107342691832799,
966
+ 0.398876404494382,
967
+ 0.4273504273504274,
968
+ 0.4273504273504274,
969
+ 0.6666666666666666,
970
+ 0.8235294117647058,
971
+ 0.35943060498220647,
972
+ 0.41158536585365846,
973
+ 0.22782516249063714,
974
+ 0.16316889680204447,
975
+ 0.22620250509980366,
976
+ 0.3164278966985974,
977
+ 0.13,
978
+ 0.007952146375791697,
979
+ 0.6666666666666666,
980
+ 0.5714285714285714,
981
+ ],
982
+ [
983
+ 0.4358974358974359,
984
+ 0.43059868772385734,
985
+ 0.42696629213483145,
986
+ 0.4358974358974359,
987
+ 0.4358974358974359,
988
+ 0.6666666666666666,
989
+ 0.8823529411764706,
990
+ 0.32384341637010683,
991
+ 0.426829268292683,
992
+ 0.24721289293739582,
993
+ 0.15194936000603573,
994
+ 0.1801295127701625,
995
+ 0.21429277824573129,
996
+ 0.13,
997
+ 0.007600281491907108,
998
+ 0.6666666666666666,
999
+ 0.7142857142857142,
1000
+ ],
1001
+ [
1002
+ 0.4444444444444445,
1003
+ 0.42823128441833647,
1004
+ 0.4157303370786517,
1005
+ 0.4444444444444445,
1006
+ 0.4444444444444445,
1007
+ 0.6666666666666666,
1008
+ 0.9411764705882353,
1009
+ 0.2882562277580072,
1010
+ 0.5975609756097562,
1011
+ 0.31688211274071565,
1012
+ 0.12024197340861972,
1013
+ 0.09468158796128598,
1014
+ 0.07727144070195302,
1015
+ 0.105,
1016
+ 0.008444757213230118,
1017
+ 0.6666666666666666,
1018
+ 0.8571428571428572,
1019
+ ],
1020
+ [
1021
+ 0.452991452991453,
1022
+ 0.4431602112975479,
1023
+ 0.43258426966292135,
1024
+ 0.452991452991453,
1025
+ 0.452991452991453,
1026
+ 0.6666666666666666,
1027
+ 1.0,
1028
+ 0.25266903914590755,
1029
+ -1.0,
1030
+ 0.39799453934810447,
1031
+ 0.0001414661638489788,
1032
+ 0.03743668935364358,
1033
+ 0.027419613352930545,
1034
+ 0.14,
1035
+ 0.00450387051372273,
1036
+ 0.6666666666666666,
1037
+ 1.0,
1038
+ ],
1039
+ [
1040
+ 0.46153846153846156,
1041
+ 0.4486433350453922,
1042
+ 0.4382022471910112,
1043
+ 0.46153846153846156,
1044
+ 0.46153846153846156,
1045
+ 0.8333333333333334,
1046
+ 0.0,
1047
+ 1.0000000000000002,
1048
+ 0.0274390243902439,
1049
+ 0.0,
1050
+ 0.045607663417779054,
1051
+ 0.0730876530735452,
1052
+ 0.16024130487418112,
1053
+ 0.095,
1054
+ 0.010415200562983815,
1055
+ 0.8333333333333334,
1056
+ 0.0,
1057
+ ],
1058
+ [
1059
+ 0.47008547008547014,
1060
+ 0.463684509495124,
1061
+ 0.4550561797752809,
1062
+ 0.47008547008547014,
1063
+ 0.47008547008547014,
1064
+ 0.8333333333333334,
1065
+ 0.058823529411764705,
1066
+ 0.8220640569395019,
1067
+ 0.05792682926829271,
1068
+ 0.06368183245946799,
1069
+ 0.08755897491589865,
1070
+ 0.25113911501725356,
1071
+ 0.36928580441210074,
1072
+ 0.11,
1073
+ 0.007741027445460941,
1074
+ 0.8333333333333334,
1075
+ 0.14285714285714285,
1076
+ ],
1077
+ [
1078
+ 0.47863247863247865,
1079
+ 0.46905198423091704,
1080
+ 0.4606741573033708,
1081
+ 0.47863247863247865,
1082
+ 0.47863247863247865,
1083
+ 0.8333333333333334,
1084
+ 0.1176470588235294,
1085
+ 0.7864768683274024,
1086
+ 0.12195121951219515,
1087
+ 0.08132988619614859,
1088
+ 0.14999813621542551,
1089
+ 0.2996905165894547,
1090
+ 0.6364740024348741,
1091
+ 0.08,
1092
+ 0.007107670654468685,
1093
+ 0.8333333333333334,
1094
+ -1.0,
1095
+ ],
1096
+ [
1097
+ 0.4871794871794872,
1098
+ 0.47317112992486215,
1099
+ 0.4606741573033708,
1100
+ 0.4871794871794872,
1101
+ 0.4871794871794872,
1102
+ 0.8333333333333334,
1103
+ -1.0,
1104
+ 0.7864768683274024,
1105
+ 0.1280487804878049,
1106
+ 0.07948389590934354,
1107
+ 0.16512012059265466,
1108
+ 0.2686786265799859,
1109
+ 0.6328933054607335,
1110
+ 0.08,
1111
+ 0.006896551724137932,
1112
+ 0.8333333333333334,
1113
+ -1.0,
1114
+ ],
1115
+ [
1116
+ 0.4957264957264958,
1117
+ 0.47586507161735137,
1118
+ 0.4606741573033708,
1119
+ 0.4957264957264958,
1120
+ 0.4957264957264958,
1121
+ 0.8333333333333334,
1122
+ -1.0,
1123
+ 0.7864768683274024,
1124
+ 0.13109756097560973,
1125
+ 0.07630898591345106,
1126
+ 0.16512012059265466,
1127
+ 0.3024866706067019,
1128
+ 0.6460225276992488,
1129
+ 0.06,
1130
+ 0.006966924700914849,
1131
+ 0.8333333333333334,
1132
+ -1.0,
1133
+ ],
1134
+ [
1135
+ 0.5042735042735044,
1136
+ 0.48720547768144135,
1137
+ 0.47191011235955055,
1138
+ 0.5042735042735044,
1139
+ 0.5042735042735044,
1140
+ 0.8333333333333334,
1141
+ -1.0,
1142
+ 0.7508896797153027,
1143
+ 0.13414634146341461,
1144
+ 0.07882185227245272,
1145
+ 0.1709737919644853,
1146
+ 0.3240933152854302,
1147
+ 0.5699753443436925,
1148
+ 0.065,
1149
+ 0.006755805770584096,
1150
+ 0.8333333333333334,
1151
+ -1.0,
1152
+ ],
1153
+ [
1154
+ 0.5128205128205129,
1155
+ 0.4897837703618793,
1156
+ 0.47191011235955055,
1157
+ 0.5128205128205129,
1158
+ 0.5128205128205129,
1159
+ 0.8333333333333334,
1160
+ -1.0,
1161
+ 0.7508896797153027,
1162
+ 0.13109756097560973,
1163
+ 0.08157634039674291,
1164
+ 0.17707136631014223,
1165
+ 0.3024866706067019,
1166
+ 0.55735765024434,
1167
+ 0.05500000000000001,
1168
+ -1.0,
1169
+ 0.8333333333333334,
1170
+ -1.0,
1171
+ ],
1172
+ [
1173
+ 0.5213675213675214,
1174
+ 0.5080154969676149,
1175
+ 0.4943820224719101,
1176
+ 0.5213675213675214,
1177
+ 0.5213675213675214,
1178
+ 0.8333333333333334,
1179
+ -1.0,
1180
+ 0.7508896797153027,
1181
+ 0.14329268292682926,
1182
+ 0.0845579529804045,
1183
+ 0.18341284362962543,
1184
+ 0.33832828119141584,
1185
+ 0.35172333830083996,
1186
+ 0.07,
1187
+ 0.007248416608022519,
1188
+ 0.8333333333333334,
1189
+ -1.0,
1190
+ ],
1191
+ [
1192
+ 0.52991452991453,
1193
+ 0.5134714091832119,
1194
+ 0.5,
1195
+ 0.52991452991453,
1196
+ 0.52991452991453,
1197
+ 0.8333333333333334,
1198
+ -1.0,
1199
+ 0.7508896797153027,
1200
+ 0.1524390243902439,
1201
+ 0.08584821320704569,
1202
+ 0.12780296559723434,
1203
+ 0.27477932625397977,
1204
+ 0.30653835267478063,
1205
+ 0.09,
1206
+ 0.0061928219563687536,
1207
+ 0.8333333333333334,
1208
+ -1.0,
1209
+ ],
1210
+ [
1211
+ 0.5384615384615385,
1212
+ 0.5314514291156592,
1213
+ 0.5224719101123595,
1214
+ 0.5384615384615385,
1215
+ 0.5384615384615385,
1216
+ 0.8333333333333334,
1217
+ -1.0,
1218
+ 0.7153024911032031,
1219
+ 0.1524390243902439,
1220
+ 0.10902940536883562,
1221
+ 0.19268115663502394,
1222
+ 0.3993352779313545,
1223
+ 0.6039067109081672,
1224
+ 0.07,
1225
+ 0.009992962702322309,
1226
+ 0.8333333333333334,
1227
+ -1.0,
1228
+ ],
1229
+ [
1230
+ 0.5470085470085471,
1231
+ 0.5371488436799516,
1232
+ 0.5280898876404494,
1233
+ 0.5470085470085471,
1234
+ 0.5470085470085471,
1235
+ 0.8333333333333334,
1236
+ -1.0,
1237
+ 0.7153024911032031,
1238
+ 0.1524390243902439,
1239
+ 0.09519414308840943,
1240
+ 0.20072995477129107,
1241
+ 0.41077408982009295,
1242
+ 0.596574807580165,
1243
+ 0.105,
1244
+ 0.0061928219563687536,
1245
+ 0.8333333333333334,
1246
+ -1.0,
1247
+ ],
1248
+ [
1249
+ 0.5555555555555557,
1250
+ 0.5493089971529934,
1251
+ 0.5449438202247191,
1252
+ 0.5555555555555557,
1253
+ 0.5555555555555557,
1254
+ 0.8333333333333334,
1255
+ -1.0,
1256
+ 0.7153024911032031,
1257
+ 0.15853658536585366,
1258
+ 0.09882330200304443,
1259
+ 0.20853484993373195,
1260
+ 0.42348388080758015,
1261
+ 0.48352708882515627,
1262
+ 0.09,
1263
+ 0.005348346235045743,
1264
+ 0.8333333333333334,
1265
+ -1.0,
1266
+ ],
1267
+ [
1268
+ 0.5641025641025642,
1269
+ 0.557574500073131,
1270
+ 0.550561797752809,
1271
+ 0.5641025641025642,
1272
+ 0.5641025641025642,
1273
+ 0.8333333333333334,
1274
+ -1.0,
1275
+ 0.7153024911032031,
1276
+ 0.16158536585365854,
1277
+ 0.10281489356561238,
1278
+ 0.21463242427938886,
1279
+ 0.43949821745181405,
1280
+ 0.509615023922466,
1281
+ 0.13,
1282
+ 0.004996481351161154,
1283
+ 0.8333333333333334,
1284
+ -1.0,
1285
+ ],
1286
+ [
1287
+ 0.5726495726495727,
1288
+ 0.5654964573986455,
1289
+ 0.5561797752808989,
1290
+ 0.5726495726495727,
1291
+ 0.5726495726495727,
1292
+ 0.8333333333333334,
1293
+ -1.0,
1294
+ 0.7153024911032031,
1295
+ 0.16463414634146342,
1296
+ 0.10698045279918819,
1297
+ 0.22121780457269832,
1298
+ 0.45271640007880076,
1299
+ 0.596574807580165,
1300
+ 0.065,
1301
+ 0.005207600281491907,
1302
+ 0.8333333333333334,
1303
+ -1.0,
1304
+ ],
1305
+ [
1306
+ 0.5811965811965812,
1307
+ 0.5711938719629379,
1308
+ 0.5617977528089888,
1309
+ 0.5811965811965812,
1310
+ 0.5811965811965812,
1311
+ 0.8333333333333334,
1312
+ -1.0,
1313
+ 0.6797153024911033,
1314
+ 0.1676829268292683,
1315
+ 0.11068209824340977,
1316
+ 0.22731537891835524,
1317
+ 0.4585629039330449,
1318
+ 0.37832280153731257,
1319
+ 0.075,
1320
+ 0.004644616467276566,
1321
+ 0.8333333333333334,
1322
+ -1.0,
1323
+ ],
1324
+ [
1325
+ 0.5897435897435899,
1326
+ 0.5852078110703316,
1327
+ 0.5786516853932584,
1328
+ 0.5897435897435899,
1329
+ 0.5897435897435899,
1330
+ 0.8333333333333334,
1331
+ -1.0,
1332
+ 0.6797153024911033,
1333
+ 0.12195121951219515,
1334
+ 0.11405997052214464,
1335
+ 0.1699981800691802,
1336
+ 0.2752877178934793,
1337
+ 0.24975872922769482,
1338
+ 0.065,
1339
+ 0.004292751583391977,
1340
+ 0.8333333333333334,
1341
+ -1.0,
1342
+ ],
1343
+ [
1344
+ 0.5982905982905984,
1345
+ 0.5917147687189832,
1346
+ 0.5842696629213483,
1347
+ 0.5982905982905984,
1348
+ 0.5982905982905984,
1349
+ 0.8333333333333334,
1350
+ -1.0,
1351
+ 0.6441281138790037,
1352
+ 0.17378048780487806,
1353
+ 0.07403290888443234,
1354
+ 0.2399983335573216,
1355
+ 0.4885580106635147,
1356
+ 0.6259024208921734,
1357
+ 0.095,
1358
+ 0.00422237860661506,
1359
+ 0.8333333333333334,
1360
+ -1.0,
1361
+ ],
1362
+ [
1363
+ 0.6068376068376069,
1364
+ 0.6036980472324172,
1365
+ 0.5955056179775281,
1366
+ 0.6068376068376069,
1367
+ 0.6068376068376069,
1368
+ 0.8333333333333334,
1369
+ 0.1764705882352941,
1370
+ 0.6085409252669042,
1371
+ 0.1829268292682927,
1372
+ 0.14164834368279897,
1373
+ 0.32438876250121335,
1374
+ 0.6319244530023704,
1375
+ 0.8306841859370685,
1376
+ 0.07,
1377
+ 0.0035186488388458817,
1378
+ 0.8333333333333334,
1379
+ -1.0,
1380
+ ],
1381
+ [
1382
+ 0.6153846153846155,
1383
+ 0.6120587905154204,
1384
+ 0.6067415730337078,
1385
+ 0.6153846153846155,
1386
+ 0.6153846153846155,
1387
+ 0.8333333333333334,
1388
+ 0.23529411764705882,
1389
+ 0.5729537366548044,
1390
+ 0.2439024390243902,
1391
+ 0.1766593374731196,
1392
+ 0.40731577360214744,
1393
+ 0.8274010383899237,
1394
+ 0.9764697055985051,
1395
+ 0.08,
1396
+ 0.003237156931738213,
1397
+ 0.8333333333333334,
1398
+ -1.0,
1399
+ ],
1400
+ [
1401
+ 0.623931623931624,
1402
+ 0.6218957594228435,
1403
+ 0.6179775280898876,
1404
+ 0.623931623931624,
1405
+ 0.623931623931624,
1406
+ 0.8333333333333334,
1407
+ 0.2941176470588235,
1408
+ 0.5373665480427048,
1409
+ 0.5060975609756098,
1410
+ 0.19185251407446782,
1411
+ 0.4707305467969794,
1412
+ 0.9318755203070687,
1413
+ 0.99300911543144,
1414
+ 0.095,
1415
+ 0.002674173117522871,
1416
+ 0.8333333333333334,
1417
+ -1.0,
1418
+ ],
1419
+ [
1420
+ 0.6324786324786326,
1421
+ 0.6299469715265329,
1422
+ 0.6235955056179775,
1423
+ 0.6324786324786326,
1424
+ 0.6324786324786326,
1425
+ 0.8333333333333334,
1426
+ 0.3529411764705882,
1427
+ 0.5373665480427048,
1428
+ 0.36585365853658536,
1429
+ 0.19037862130620728,
1430
+ 0.5121940523474464,
1431
+ 0.8741730692238767,
1432
+ 1.0,
1433
+ 0.09,
1434
+ 0.00302603800140746,
1435
+ 0.8333333333333334,
1436
+ -1.0,
1437
+ ],
1438
+ [
1439
+ 0.6410256410256411,
1440
+ 0.6436309708054273,
1441
+ 0.6404494382022472,
1442
+ 0.6410256410256411,
1443
+ 0.6410256410256411,
1444
+ 0.8333333333333334,
1445
+ 0.4117647058823529,
1446
+ 0.5017793594306051,
1447
+ 0.4573170731707318,
1448
+ 0.21960035760021265,
1449
+ 0.5512185281596508,
1450
+ 0.8352811088021659,
1451
+ 0.9004225222429487,
1452
+ 0.08,
1453
+ 0.0025334271639690367,
1454
+ 0.8333333333333334,
1455
+ -1.0,
1456
+ ],
1457
+ [
1458
+ 0.6495726495726497,
1459
+ 0.650389635127367,
1460
+ 0.6460674157303371,
1461
+ 0.6495726495726497,
1462
+ 0.6495726495726497,
1463
+ 0.8333333333333334,
1464
+ 0.47058823529411764,
1465
+ 0.5017793594306051,
1466
+ 0.4573170731707318,
1467
+ 0.24515427549713678,
1468
+ 0.5512185281596508,
1469
+ 0.6868307500683152,
1470
+ 0.8008450444858972,
1471
+ 0.11,
1472
+ 0.002603800140745954,
1473
+ 0.8333333333333334,
1474
+ -1.0,
1475
+ ],
1476
+ [
1477
+ 0.6581196581196582,
1478
+ 0.6601415679965169,
1479
+ 0.6573033707865168,
1480
+ 0.6581196581196582,
1481
+ 0.6581196581196582,
1482
+ 0.8333333333333334,
1483
+ 0.5294117647058824,
1484
+ 0.4661921708185055,
1485
+ 0.4817073170731707,
1486
+ 0.2447531833667577,
1487
+ 0.5243892010387603,
1488
+ 0.5162653550162368,
1489
+ 0.6980278885141472,
1490
+ 0.14500000000000002,
1491
+ 0.00274454609429979,
1492
+ 0.8333333333333334,
1493
+ -1.0,
1494
+ ],
1495
+ [
1496
+ 0.6666666666666667,
1497
+ 0.6665464823992409,
1498
+ 0.6629213483146067,
1499
+ 0.6666666666666667,
1500
+ 0.6666666666666667,
1501
+ 0.8333333333333334,
1502
+ 0.5882352941176471,
1503
+ 0.4661921708185055,
1504
+ 0.5609756097560976,
1505
+ 0.25764612076255833,
1506
+ 0.4707305467969794,
1507
+ 0.33644214820887275,
1508
+ 0.5328042995645191,
1509
+ 0.09,
1510
+ 0.002463054187192118,
1511
+ 0.8333333333333334,
1512
+ -1.0,
1513
+ ],
1514
+ [
1515
+ 0.6752136752136753,
1516
+ 0.6788699050657669,
1517
+ 0.6797752808988764,
1518
+ 0.6752136752136753,
1519
+ 0.6752136752136753,
1520
+ 0.8333333333333334,
1521
+ 0.6470588235294117,
1522
+ 0.4661921708185055,
1523
+ 0.39634146341463417,
1524
+ 0.31621523666851903,
1525
+ 0.3292668219777389,
1526
+ 0.05598790027897992,
1527
+ 0.1067013596417939,
1528
+ 0.115,
1529
+ 0.003237156931738213,
1530
+ 0.8333333333333334,
1531
+ -1.0,
1532
+ ],
1533
+ [
1534
+ 0.6837606837606839,
1535
+ 0.6917715727925495,
1536
+ 0.6910112359550562,
1537
+ 0.6837606837606839,
1538
+ 0.6837606837606839,
1539
+ 0.8333333333333334,
1540
+ 0.7058823529411764,
1541
+ 0.5729537366548044,
1542
+ 0.4085365853658537,
1543
+ 0.10700461497571703,
1544
+ 0.2902423461655346,
1545
+ 0.14310589162361226,
1546
+ 0.29698982741040586,
1547
+ 0.125,
1548
+ 0.002463054187192118,
1549
+ 0.8333333333333334,
1550
+ 0.2857142857142857,
1551
+ ],
1552
+ [
1553
+ 0.6923076923076924,
1554
+ 0.7013534335851533,
1555
+ 0.7022471910112359,
1556
+ 0.6923076923076924,
1557
+ 0.6923076923076924,
1558
+ 0.8333333333333334,
1559
+ 0.7647058823529411,
1560
+ 0.4661921708185055,
1561
+ 0.4969512195121951,
1562
+ 0.1702370309517481,
1563
+ 0.27560816773595803,
1564
+ 0.14910491296970624,
1565
+ 0.3440504162133959,
1566
+ 0.13,
1567
+ 0.002463054187192118,
1568
+ 0.8333333333333334,
1569
+ 0.42857142857142855,
1570
+ ],
1571
+ [
1572
+ 0.7008547008547009,
1573
+ 0.7074079995101924,
1574
+ 0.7078651685393258,
1575
+ 0.7008547008547009,
1576
+ 0.7008547008547009,
1577
+ 0.8333333333333334,
1578
+ 0.8235294117647058,
1579
+ 0.3950177935943062,
1580
+ 0.4024390243902439,
1581
+ 0.1639017082658806,
1582
+ 0.2392666246358428,
1583
+ 0.13484961139814058,
1584
+ 0.31250618096501487,
1585
+ 0.08,
1586
+ 0.0019704433497536944,
1587
+ 0.8333333333333334,
1588
+ 0.5714285714285714,
1589
+ ],
1590
+ [
1591
+ 0.7094017094017095,
1592
+ 0.7108774698717316,
1593
+ 0.7078651685393258,
1594
+ 0.7094017094017095,
1595
+ 0.7094017094017095,
1596
+ 0.8333333333333334,
1597
+ 0.8823529411764706,
1598
+ 0.35943060498220647,
1599
+ 0.39634146341463417,
1600
+ 0.21857588131538888,
1601
+ 0.22731537891835524,
1602
+ 0.13039610063612506,
1603
+ 0.20985953437298585,
1604
+ 0.15500000000000003,
1605
+ -1.0,
1606
+ 0.8333333333333334,
1607
+ 0.7142857142857142,
1608
+ ],
1609
+ [
1610
+ 0.7179487179487181,
1611
+ 0.7108774698717316,
1612
+ 0.7022471910112359,
1613
+ 0.7179487179487181,
1614
+ 0.7179487179487181,
1615
+ 0.8333333333333334,
1616
+ 0.9411764705882353,
1617
+ 0.32384341637010683,
1618
+ 0.4573170731707318,
1619
+ 0.26124628506535874,
1620
+ 0.17072988899065902,
1621
+ 0.14259749998411278,
1622
+ 0.10329117204737433,
1623
+ 0.09,
1624
+ -1.0,
1625
+ 0.8333333333333334,
1626
+ 0.8571428571428572,
1627
+ ],
1628
+ [
1629
+ 0.7264957264957266,
1630
+ 0.7516947682427814,
1631
+ 0.7640449438202247,
1632
+ 0.7264957264957266,
1633
+ 0.7264957264957266,
1634
+ 0.8333333333333334,
1635
+ 1.0,
1636
+ 0.2882562277580072,
1637
+ -1.0,
1638
+ 0.3312441104694711,
1639
+ 0.00023512490579826907,
1640
+ 0.047782459217458176,
1641
+ 0.03530908235262022,
1642
+ 0.085,
1643
+ 0.0,
1644
+ 0.8333333333333334,
1645
+ 1.0,
1646
+ ],
1647
+ [
1648
+ 0.7350427350427351,
1649
+ 0.7550962097737021,
1650
+ 0.7640449438202247,
1651
+ 0.7350427350427351,
1652
+ 0.7350427350427351,
1653
+ 0.9999999999999999,
1654
+ 0.0,
1655
+ -1.0,
1656
+ 0.0,
1657
+ 0.00864039432672098,
1658
+ 0.045607663417779054,
1659
+ 0.0726936495529331,
1660
+ 0.161264361152507,
1661
+ 0.09,
1662
+ -1.0,
1663
+ 0.9999999999999999,
1664
+ 0.0,
1665
+ ],
1666
+ [
1667
+ 0.7435897435897437,
1668
+ 0.7653005343664645,
1669
+ 0.7752808988764045,
1670
+ 0.7435897435897437,
1671
+ 0.7435897435897437,
1672
+ 0.9999999999999999,
1673
+ 0.058823529411764705,
1674
+ -1.0,
1675
+ 0.06097560975609759,
1676
+ 0.06690506680841815,
1677
+ 0.1341444429167175,
1678
+ 0.243767436244511,
1679
+ 0.34200430365674417,
1680
+ 0.06,
1681
+ -1.0,
1682
+ 0.9999999999999999,
1683
+ 0.14285714285714285,
1684
+ ],
1685
+ [
1686
+ 0.7521367521367522,
1687
+ 0.7687019758973853,
1688
+ 0.7752808988764045,
1689
+ 0.7521367521367522,
1690
+ 0.7521367521367522,
1691
+ 0.9999999999999999,
1692
+ 0.1176470588235294,
1693
+ -1.0,
1694
+ 0.12195121951219515,
1695
+ 0.061666706936960886,
1696
+ 0.24633981087680482,
1697
+ 0.3327359731569215,
1698
+ 0.5911185074290938,
1699
+ 0.04,
1700
+ 0.0018296973961998584,
1701
+ 0.9999999999999999,
1702
+ -1.0,
1703
+ ],
1704
+ [
1705
+ 0.7606837606837608,
1706
+ 0.7858384383301644,
1707
+ 0.797752808988764,
1708
+ 0.7606837606837608,
1709
+ 0.7606837606837608,
1710
+ 0.9999999999999999,
1711
+ -1.0,
1712
+ -1.0,
1713
+ 0.1829268292682927,
1714
+ 0.11659699905767515,
1715
+ 0.28536428668900904,
1716
+ 0.5119440260804912,
1717
+ 0.8622284211854495,
1718
+ 0.045,
1719
+ 0.001337086558761435,
1720
+ 0.9999999999999999,
1721
+ -1.0,
1722
+ ],
1723
+ [
1724
+ 0.7692307692307694,
1725
+ 0.7824301939161817,
1726
+ 0.7865168539325842,
1727
+ 0.7692307692307694,
1728
+ 0.7692307692307694,
1729
+ 0.9999999999999999,
1730
+ -1.0,
1731
+ -1.0,
1732
+ 0.2439024390243902,
1733
+ 0.09646024113852172,
1734
+ 0.3756083870047315,
1735
+ 0.4725436740192808,
1736
+ 0.7324707832177849,
1737
+ 0.05500000000000001,
1738
+ -1.0,
1739
+ 0.9999999999999999,
1740
+ -1.0,
1741
+ ],
1742
+ [
1743
+ 0.7777777777777779,
1744
+ 0.8062164745419109,
1745
+ 0.8202247191011236,
1746
+ 0.7777777777777779,
1747
+ 0.7777777777777779,
1748
+ 0.9999999999999999,
1749
+ -1.0,
1750
+ -1.0,
1751
+ 0.2073170731707317,
1752
+ 0.11115567690337544,
1753
+ 0.4634134575821911,
1754
+ 0.3535800303764005,
1755
+ 0.7502037587087667,
1756
+ 0.06,
1757
+ 0.00154820548909219,
1758
+ 0.9999999999999999,
1759
+ -1.0,
1760
+ ],
1761
+ [
1762
+ 0.7863247863247864,
1763
+ 0.8027163912065933,
1764
+ 0.8089887640449438,
1765
+ 0.7863247863247864,
1766
+ 0.7863247863247864,
1767
+ 0.9999999999999999,
1768
+ -1.0,
1769
+ -1.0,
1770
+ 0.201219512195122,
1771
+ 0.11461570058230844,
1772
+ 0.49999890365613264,
1773
+ 0.22851568705952632,
1774
+ 0.7278670299653185,
1775
+ 0.75,
1776
+ -1.0,
1777
+ 0.9999999999999999,
1778
+ -1.0,
1779
+ ],
1780
+ [
1781
+ 0.7948717948717949,
1782
+ 0.826526481923039,
1783
+ 0.8426966292134831,
1784
+ 0.7948717948717949,
1785
+ 0.7948717948717949,
1786
+ 0.9999999999999999,
1787
+ -1.0,
1788
+ -1.0,
1789
+ 0.17682926829268295,
1790
+ 0.10304201802498372,
1791
+ 0.4829256954882932,
1792
+ 0.22851568705952632,
1793
+ 0.5962337888207231,
1794
+ 0.8,
1795
+ -1.0,
1796
+ 0.9999999999999999,
1797
+ -1.0,
1798
+ ],
1799
+ [
1800
+ 0.8034188034188036,
1801
+ 0.8231250403921182,
1802
+ 0.8314606741573034,
1803
+ 0.8034188034188036,
1804
+ 0.8034188034188036,
1805
+ 0.9999999999999999,
1806
+ -1.0,
1807
+ -1.0,
1808
+ 0.1829268292682927,
1809
+ 0.10050982192475896,
1810
+ 0.3341448814542644,
1811
+ 0.3185010072509358,
1812
+ 0.4903474640139954,
1813
+ 0.65,
1814
+ -1.0,
1815
+ 0.9999999999999999,
1816
+ -1.0,
1817
+ ],
1818
+ [
1819
+ 0.8119658119658121,
1820
+ 0.8367308065158015,
1821
+ 0.848314606741573,
1822
+ 0.8119658119658121,
1823
+ 0.8119658119658121,
1824
+ 0.9999999999999999,
1825
+ -1.0,
1826
+ -1.0,
1827
+ 0.1829268292682927,
1828
+ 0.10136516297388068,
1829
+ 0.3292668219777389,
1830
+ 0.3370573020926671,
1831
+ 0.5761136820136477,
1832
+ 0.65,
1833
+ -1.0,
1834
+ 0.9999999999999999,
1835
+ -1.0,
1836
+ ],
1837
+ [
1838
+ 0.8205128205128206,
1839
+ 0.8367308065158015,
1840
+ 0.8426966292134831,
1841
+ 0.8205128205128206,
1842
+ 0.8205128205128206,
1843
+ 0.9999999999999999,
1844
+ -1.0,
1845
+ -1.0,
1846
+ 0.1829268292682927,
1847
+ 0.11133930944499479,
1848
+ 0.3609742085751549,
1849
+ 0.31646744069293786,
1850
+ 0.16689117068329928,
1851
+ 0.4,
1852
+ -1.0,
1853
+ 0.9999999999999999,
1854
+ -1.0,
1855
+ ],
1856
+ [
1857
+ 0.8290598290598292,
1858
+ 0.8503365726394846,
1859
+ 0.8595505617977528,
1860
+ 0.8290598290598292,
1861
+ 0.8290598290598292,
1862
+ 0.9999999999999999,
1863
+ -1.0,
1864
+ -1.0,
1865
+ 0.1829268292682927,
1866
+ 0.11538889023123203,
1867
+ 0.3682912977899432,
1868
+ 0.48576185664626753,
1869
+ 0.1992879528302852,
1870
+ 0.6,
1871
+ -1.0,
1872
+ 0.9999999999999999,
1873
+ -1.0,
1874
+ ],
1875
+ [
1876
+ 0.8376068376068377,
1877
+ 0.8537380141704054,
1878
+ 0.8595505617977528,
1879
+ 0.8376068376068377,
1880
+ 0.8376068376068377,
1881
+ 0.9999999999999999,
1882
+ -1.0,
1883
+ -1.0,
1884
+ 0.1829268292682927,
1885
+ 0.12207214825911519,
1886
+ 0.3292668219777389,
1887
+ 0.28443876740447005,
1888
+ -1.0,
1889
+ 0.6,
1890
+ -1.0,
1891
+ 0.9999999999999999,
1892
+ -1.0,
1893
+ ],
1894
+ [
1895
+ 0.8461538461538463,
1896
+ 0.8707452218250095,
1897
+ 0.8820224719101123,
1898
+ 0.8461538461538463,
1899
+ 0.8461538461538463,
1900
+ 0.9999999999999999,
1901
+ -1.0,
1902
+ -1.0,
1903
+ 0.1829268292682927,
1904
+ 0.12593809650373308,
1905
+ -1.0,
1906
+ -1.0,
1907
+ -1.0,
1908
+ 0.5,
1909
+ -1.0,
1910
+ 0.9999999999999999,
1911
+ -1.0,
1912
+ ],
1913
+ [
1914
+ 0.8547008547008548,
1915
+ 0.8741466633559303,
1916
+ 0.8820224719101123,
1917
+ 0.8547008547008548,
1918
+ 0.8547008547008548,
1919
+ 0.9999999999999999,
1920
+ -1.0,
1921
+ -1.0,
1922
+ 0.1829268292682927,
1923
+ 0.12980404474835092,
1924
+ -1.0,
1925
+ -1.0,
1926
+ -1.0,
1927
+ 0.15000000000000002,
1928
+ -1.0,
1929
+ 0.9999999999999999,
1930
+ -1.0,
1931
+ ],
1932
+ [
1933
+ 0.8632478632478634,
1934
+ 0.8775481048868511,
1935
+ 0.8820224719101123,
1936
+ 0.8632478632478634,
1937
+ 0.8632478632478634,
1938
+ 0.9999999999999999,
1939
+ -1.0,
1940
+ -1.0,
1941
+ 0.1829268292682927,
1942
+ 0.1331867494623916,
1943
+ -1.0,
1944
+ -1.0,
1945
+ -1.0,
1946
+ 0.35,
1947
+ -1.0,
1948
+ 0.9999999999999999,
1949
+ -1.0,
1950
+ ],
1951
+ [
1952
+ 0.8717948717948719,
1953
+ 0.8877524294796135,
1954
+ 0.8932584269662921,
1955
+ 0.8717948717948719,
1956
+ 0.8717948717948719,
1957
+ 0.9999999999999999,
1958
+ -1.0,
1959
+ -1.0,
1960
+ -1.0,
1961
+ -1.0,
1962
+ -1.0,
1963
+ -1.0,
1964
+ -1.0,
1965
+ 1.0000000000000002,
1966
+ -1.0,
1967
+ 0.9999999999999999,
1968
+ -1.0,
1969
+ ],
1970
+ [
1971
+ 0.8803418803418804,
1972
+ 0.8843509879486927,
1973
+ 0.8820224719101123,
1974
+ 0.8803418803418804,
1975
+ 0.8803418803418804,
1976
+ 0.9999999999999999,
1977
+ 0.1764705882352941,
1978
+ -1.0,
1979
+ -1.0,
1980
+ -1.0,
1981
+ 0.4414621899378262,
1982
+ -1.0,
1983
+ -1.0,
1984
+ -1.0,
1985
+ -1.0,
1986
+ 0.9999999999999999,
1987
+ -1.0,
1988
+ ],
1989
+ [
1990
+ 0.8888888888888891,
1991
+ 0.8877524294796135,
1992
+ 0.8820224719101123,
1993
+ 0.8888888888888891,
1994
+ 0.8888888888888891,
1995
+ 0.9999999999999999,
1996
+ 0.23529411764705882,
1997
+ -1.0,
1998
+ -1.0,
1999
+ -1.0,
2000
+ 0.9512194052347446,
2001
+ -1.0,
2002
+ -1.0,
2003
+ -1.0,
2004
+ -1.0,
2005
+ 0.9999999999999999,
2006
+ -1.0,
2007
+ ],
2008
+ [
2009
+ 0.8974358974358976,
2010
+ 0.9013581956032967,
2011
+ 0.898876404494382,
2012
+ 0.8974358974358976,
2013
+ 0.8974358974358976,
2014
+ 0.9999999999999999,
2015
+ 0.2941176470588235,
2016
+ -1.0,
2017
+ -1.0,
2018
+ -1.0,
2019
+ 0.8536582157042338,
2020
+ -1.0,
2021
+ -1.0,
2022
+ -1.0,
2023
+ -1.0,
2024
+ 0.9999999999999999,
2025
+ -1.0,
2026
+ ],
2027
+ [
2028
+ 0.9059829059829061,
2029
+ 0.894555312541455,
2030
+ 0.8820224719101123,
2031
+ 0.9059829059829061,
2032
+ 0.9059829059829061,
2033
+ 0.9999999999999999,
2034
+ 0.3529411764705882,
2035
+ -1.0,
2036
+ -1.0,
2037
+ -1.0,
2038
+ 0.9024388104694893,
2039
+ -1.0,
2040
+ -1.0,
2041
+ -1.0,
2042
+ -1.0,
2043
+ 0.9999999999999999,
2044
+ -1.0,
2045
+ ],
2046
+ [
2047
+ 0.9145299145299146,
2048
+ 0.9047596371342175,
2049
+ 0.8932584269662921,
2050
+ 0.9145299145299146,
2051
+ 0.9145299145299146,
2052
+ 0.9999999999999999,
2053
+ 0.4117647058823529,
2054
+ -1.0,
2055
+ -1.0,
2056
+ -1.0,
2057
+ 1.0,
2058
+ -1.0,
2059
+ -1.0,
2060
+ -1.0,
2061
+ -1.0,
2062
+ 0.9999999999999999,
2063
+ -1.0,
2064
+ ],
2065
+ [
2066
+ 0.9230769230769232,
2067
+ 0.9081610786651383,
2068
+ 0.8932584269662921,
2069
+ 0.9230769230769232,
2070
+ 0.9230769230769232,
2071
+ 0.9999999999999999,
2072
+ 0.47058823529411764,
2073
+ -1.0,
2074
+ -1.0,
2075
+ -1.0,
2076
+ 0.8536582157042338,
2077
+ -1.0,
2078
+ -1.0,
2079
+ -1.0,
2080
+ -1.0,
2081
+ 0.9999999999999999,
2082
+ -1.0,
2083
+ ],
2084
+ [
2085
+ 0.9316239316239318,
2086
+ 0.9183654032579007,
2087
+ 0.9044943820224719,
2088
+ 0.9316239316239318,
2089
+ 0.9316239316239318,
2090
+ 0.9999999999999999,
2091
+ 0.5294117647058824,
2092
+ -1.0,
2093
+ -1.0,
2094
+ -1.0,
2095
+ -1.0,
2096
+ -1.0,
2097
+ -1.0,
2098
+ -1.0,
2099
+ -1.0,
2100
+ 0.9999999999999999,
2101
+ -1.0,
2102
+ ],
2103
+ [
2104
+ 0.9401709401709403,
2105
+ 0.9217668447888215,
2106
+ 0.9044943820224719,
2107
+ 0.9401709401709403,
2108
+ 0.9401709401709403,
2109
+ 0.9999999999999999,
2110
+ 0.5882352941176471,
2111
+ -1.0,
2112
+ -1.0,
2113
+ -1.0,
2114
+ -1.0,
2115
+ -1.0,
2116
+ -1.0,
2117
+ -1.0,
2118
+ -1.0,
2119
+ 0.9999999999999999,
2120
+ -1.0,
2121
+ ],
2122
+ [
2123
+ 0.9487179487179489,
2124
+ 0.965985584690792,
2125
+ 0.9719101123595505,
2126
+ 0.9487179487179489,
2127
+ 0.9487179487179489,
2128
+ 0.9999999999999999,
2129
+ 0.6470588235294117,
2130
+ -1.0,
2131
+ -1.0,
2132
+ -1.0,
2133
+ -1.0,
2134
+ -1.0,
2135
+ -1.0,
2136
+ -1.0,
2137
+ -1.0,
2138
+ 0.9999999999999999,
2139
+ -1.0,
2140
+ ],
2141
+ [
2142
+ 0.9572649572649574,
2143
+ 0.9625841431598712,
2144
+ 0.9606741573033708,
2145
+ 0.9572649572649574,
2146
+ 0.9572649572649574,
2147
+ 0.9999999999999999,
2148
+ 0.7058823529411764,
2149
+ -1.0,
2150
+ -1.0,
2151
+ -1.0,
2152
+ -1.0,
2153
+ -1.0,
2154
+ -1.0,
2155
+ -1.0,
2156
+ -1.0,
2157
+ 0.9999999999999999,
2158
+ 0.2857142857142857,
2159
+ ],
2160
+ [
2161
+ 0.9658119658119659,
2162
+ 0.9795913508144752,
2163
+ 0.9831460674157303,
2164
+ 0.9658119658119659,
2165
+ 0.9658119658119659,
2166
+ 0.9999999999999999,
2167
+ 0.7647058823529411,
2168
+ -1.0,
2169
+ -1.0,
2170
+ -1.0,
2171
+ -1.0,
2172
+ -1.0,
2173
+ -1.0,
2174
+ -1.0,
2175
+ -1.0,
2176
+ 0.9999999999999999,
2177
+ 0.42857142857142855,
2178
+ ],
2179
+ [
2180
+ 0.9743589743589745,
2181
+ 0.9761899092835544,
2182
+ 0.9719101123595505,
2183
+ 0.9743589743589745,
2184
+ 0.9743589743589745,
2185
+ 0.9999999999999999,
2186
+ 0.8235294117647058,
2187
+ -1.0,
2188
+ -1.0,
2189
+ -1.0,
2190
+ -1.0,
2191
+ -1.0,
2192
+ -1.0,
2193
+ -1.0,
2194
+ -1.0,
2195
+ 0.9999999999999999,
2196
+ 0.5714285714285714,
2197
+ ],
2198
+ [
2199
+ 0.9829059829059831,
2200
+ 0.9897956754072376,
2201
+ 0.9887640449438202,
2202
+ 0.9829059829059831,
2203
+ 0.9829059829059831,
2204
+ 0.9999999999999999,
2205
+ 0.8823529411764706,
2206
+ -1.0,
2207
+ -1.0,
2208
+ -1.0,
2209
+ -1.0,
2210
+ -1.0,
2211
+ -1.0,
2212
+ -1.0,
2213
+ -1.0,
2214
+ 0.9999999999999999,
2215
+ 0.7142857142857142,
2216
+ ],
2217
+ [
2218
+ 0.9914529914529915,
2219
+ 1.0,
2220
+ 1.0,
2221
+ 0.9914529914529915,
2222
+ 0.9914529914529915,
2223
+ 0.9999999999999999,
2224
+ 0.9411764705882353,
2225
+ -1.0,
2226
+ -1.0,
2227
+ -1.0,
2228
+ -1.0,
2229
+ -1.0,
2230
+ -1.0,
2231
+ -1.0,
2232
+ -1.0,
2233
+ 0.9999999999999999,
2234
+ 0.8571428571428572,
2235
+ ],
2236
+ [
2237
+ 1.0000000000000002,
2238
+ 0.9965985584690792,
2239
+ 0.9887640449438202,
2240
+ 1.0000000000000002,
2241
+ 1.0000000000000002,
2242
+ 0.9999999999999999,
2243
+ 1.0,
2244
+ -1.0,
2245
+ -1.0,
2246
+ -1.0,
2247
+ -1.0,
2248
+ -1.0,
2249
+ -1.0,
2250
+ -1.0,
2251
+ -1.0,
2252
+ 0.9999999999999999,
2253
+ 1.0,
2254
+ ],
2255
+ ]
2256
+
2257
+
2258
+ @torch.jit.script
2259
+ def gaussian(x: torch.Tensor, mean: torch.Tensor, std: torch.Tensor) -> torch.Tensor:
2260
+ """Compute the Gaussian distribution probability density."""
2261
+ pi = 3.14159
2262
+ a = (2 * pi) ** 0.5
2263
+ output: torch.Tensor = torch.exp(-0.5 * (((x - mean) / std) ** 2)) / (a * std)
2264
+ return output
2265
+
2266
+
2267
+ class GaussianLayer(nn.Module):
2268
+ """Gaussian pairwise positional embedding layer."""
2269
+
2270
+ def __init__(self, k: int = 128, edge_types: int = 1024):
2271
+ super().__init__()
2272
+ self.k = k
2273
+ self.means = nn.Embedding(1, k)
2274
+ self.stds = nn.Embedding(1, k)
2275
+ self.mul = nn.Embedding(edge_types, 1)
2276
+ self.bias = nn.Embedding(edge_types, 1)
2277
+ nn.init.uniform_(self.means.weight, 0, 3)
2278
+ nn.init.uniform_(self.stds.weight, 0, 3)
2279
+ nn.init.constant_(self.bias.weight, 0)
2280
+ nn.init.constant_(self.mul.weight, 1)
2281
+
2282
+ def forward(self, x: torch.Tensor, edge_types: int) -> torch.Tensor:
2283
+ """Forward pass to compute the Gaussian pos. embeddings."""
2284
+ mul = self.mul(edge_types)
2285
+ bias = self.bias(edge_types)
2286
+ x = mul * x.unsqueeze(-1) + bias
2287
+ x = x.expand(-1, -1, -1, self.k)
2288
+ mean = self.means.weight.float().view(-1)
2289
+ std = self.stds.weight.float().view(-1).abs() + 1e-5
2290
+ output: torch.Tensor = gaussian(x.float(), mean, std).type_as(self.means.weight)
2291
+ return output
2292
+
2293
+
2294
+ class ParallelBlock(nn.Module):
2295
+ """Parallel transformer block (MLP & Attention in parallel).
2296
+
2297
+ Based on:
2298
+ 'Scaling Vision Atomformers to 22 Billion Parameters` - https://arxiv.org/abs/2302.05442
2299
+
2300
+ Adapted from TIMM implementation.
2301
+ """
2302
+
2303
+ def __init__(
2304
+ self,
2305
+ dim: int,
2306
+ num_heads: int,
2307
+ mlp_ratio: int = 4,
2308
+ dropout: float = 0.0,
2309
+ k: int = 128,
2310
+ gradient_checkpointing: bool = False,
2311
+ ):
2312
+ super().__init__()
2313
+ assert (
2314
+ dim % num_heads == 0
2315
+ ), f"dim {dim} should be divisible by num_heads {num_heads}"
2316
+ self.num_heads = num_heads
2317
+ self.head_dim = dim // num_heads
2318
+ self.scale = self.head_dim**-0.5
2319
+ self.mlp_hidden_dim = int(mlp_ratio * dim)
2320
+ self.proj_drop = nn.Dropout(dropout)
2321
+ self.attn_drop = nn.Dropout(dropout)
2322
+ self.gradient_checkpointing = gradient_checkpointing
2323
+
2324
+ self.in_proj_in_dim = dim
2325
+ self.in_proj_out_dim = self.mlp_hidden_dim + 3 * dim
2326
+ self.out_proj_in_dim = self.mlp_hidden_dim + dim
2327
+ self.out_proj_out_dim = 2 * dim
2328
+
2329
+ self.in_split = [self.mlp_hidden_dim] + [dim] * 3
2330
+ self.out_split = [dim] * 2
2331
+
2332
+ self.in_norm = nn.LayerNorm(dim)
2333
+ self.q_norm = nn.LayerNorm(self.head_dim)
2334
+ self.k_norm = nn.LayerNorm(self.head_dim)
2335
+ self.in_proj = nn.Linear(self.in_proj_in_dim, self.in_proj_out_dim, bias=False)
2336
+ self.act_fn = nn.GELU()
2337
+ self.out_proj = nn.Linear(
2338
+ self.out_proj_in_dim, self.out_proj_out_dim, bias=False
2339
+ )
2340
+ self.gaussian_proj = nn.Linear(k, 1)
2341
+ self.pos_embed_ff_norm = nn.LayerNorm(k)
2342
+
2343
+ def forward(
2344
+ self,
2345
+ x: torch.Tensor,
2346
+ pos_embed: torch.Tensor,
2347
+ attention_mask: Optional[torch.Tensor] = None,
2348
+ ) -> Tuple[torch.Tensor, torch.Tensor]:
2349
+ """Forward pass for the parallel block."""
2350
+ b, n, c = x.shape
2351
+ res = x
2352
+
2353
+ # Combined MLP fc1 & qkv projections
2354
+ x = self.in_proj(self.in_norm(x))
2355
+ x, q, k, v = torch.split(x, self.in_split, dim=-1)
2356
+ x = self.act_fn(x)
2357
+ x = self.proj_drop(x)
2358
+
2359
+ # Dot product attention
2360
+ q = self.q_norm(q.view(b, n, self.num_heads, self.head_dim).transpose(1, 2))
2361
+ k = self.k_norm(k.view(b, n, self.num_heads, self.head_dim).transpose(1, 2))
2362
+ v = v.view(b, n, self.num_heads, self.head_dim).transpose(1, 2)
2363
+
2364
+ x_attn = (
2365
+ f.scaled_dot_product_attention(
2366
+ q,
2367
+ k,
2368
+ v,
2369
+ attn_mask=attention_mask
2370
+ + self.gaussian_proj(self.pos_embed_ff_norm(pos_embed)).permute(
2371
+ 0, 3, 1, 2
2372
+ ),
2373
+ is_causal=False,
2374
+ )
2375
+ .transpose(1, 2)
2376
+ .reshape(b, n, c)
2377
+ )
2378
+
2379
+ # Combined MLP fc2 & attn_output projection
2380
+ x_mlp, x_attn = self.out_proj(torch.cat([x, x_attn], dim=-1)).split(
2381
+ self.out_split, dim=-1
2382
+ )
2383
+ # Residual connections
2384
+ x = x_mlp + x_attn + res
2385
+ del x_mlp, x_attn, res
2386
+
2387
+ return x, pos_embed
2388
+
2389
+
2390
+ class AtomformerEncoder(nn.Module):
2391
+ """Atomformer encoder.
2392
+
2393
+ The transformer encoder consists of a series of parallel blocks,
2394
+ each containing a multi-head self-attention mechanism and a feed-forward network.
2395
+ """
2396
+
2397
+ def __init__(self, config: AtomformerConfig):
2398
+ super().__init__()
2399
+ self.vocab_size = config.vocab_size
2400
+ self.dim = config.dim
2401
+ self.num_heads = config.num_heads
2402
+ self.depth = config.depth
2403
+ self.mlp_ratio = config.mlp_ratio
2404
+ self.dropout = config.dropout
2405
+ self.k = config.k
2406
+ self.gradient_checkpointing = config.gradient_checkpointing
2407
+
2408
+ self.metadata_vocab = nn.Embedding(self.vocab_size, 17)
2409
+ self.metadata_vocab.weight.requires_grad = False
2410
+ self.metadata_vocab.weight.fill_(-1)
2411
+ self.metadata_vocab.weight[1:-4] = torch.tensor(
2412
+ ATOM_METADATA, dtype=torch.float32
2413
+ )
2414
+ self.embed_metadata = nn.Linear(17, self.dim)
2415
+
2416
+ self.gaussian_embed = GaussianLayer(
2417
+ k=self.k, edge_types=(self.vocab_size + 1) ** 2
2418
+ )
2419
+
2420
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.dim)
2421
+ nn.init.normal_(self.embed_tokens.weight, std=0.02)
2422
+
2423
+ self.blocks = nn.ModuleList()
2424
+ for _ in range(self.depth):
2425
+ self.blocks.append(
2426
+ ParallelBlock(
2427
+ self.dim,
2428
+ self.num_heads,
2429
+ self.mlp_ratio,
2430
+ self.dropout,
2431
+ self.k,
2432
+ self.gradient_checkpointing,
2433
+ )
2434
+ )
2435
+
2436
+ def _expand_mask(
2437
+ self,
2438
+ mask: torch.Tensor,
2439
+ dtype: torch.dtype,
2440
+ device: torch.device,
2441
+ tgt_len: Optional[int] = None,
2442
+ ) -> torch.Tensor:
2443
+ """
2444
+ Expand attention mask.
2445
+
2446
+ Expands attention_mask from `[bsz, seq_len]` to
2447
+ `[bsz, 1, tgt_seq_len, src_seq_len]`.
2448
+ """
2449
+ bsz, src_len = mask.size()
2450
+ tgt_len = tgt_len if tgt_len is not None else src_len
2451
+
2452
+ expanded_mask = (
2453
+ mask[:, None, None, :].expand(bsz, 1, tgt_len, src_len).to(dtype)
2454
+ )
2455
+
2456
+ inverted_mask: torch.Tensor = 1.0 - expanded_mask
2457
+
2458
+ return inverted_mask.masked_fill(
2459
+ inverted_mask.to(torch.bool), torch.finfo(dtype).min
2460
+ ).to(device)
2461
+
2462
+ def forward(
2463
+ self,
2464
+ input_ids: torch.Tensor,
2465
+ coords: torch.Tensor,
2466
+ attention_mask: Optional[torch.Tensor] = None,
2467
+ ) -> Tuple[torch.Tensor, torch.Tensor]:
2468
+ """Forward pass for the transformer encoder."""
2469
+ # pad coords by zeros for graph token
2470
+ coords_center = torch.sum(coords, dim=1, keepdim=True) / coords.shape[1]
2471
+ coords = torch.cat([coords_center, coords], dim=1)
2472
+
2473
+ r_ij = torch.cdist(coords, coords, p=2) # [B, N, N]
2474
+ # pad input_ids by graph token
2475
+ input_ids = torch.cat(
2476
+ [
2477
+ torch.zeros(
2478
+ input_ids.size(0), 1, dtype=torch.long, device=input_ids.device
2479
+ ).fill_(122),
2480
+ input_ids,
2481
+ ],
2482
+ dim=1,
2483
+ )
2484
+ edge_type = input_ids.unsqueeze(-1) * self.vocab_size + input_ids.unsqueeze(
2485
+ -2
2486
+ ) # [B, N, N]
2487
+ pos_embeds = self.gaussian_embed(r_ij, edge_type) # [B, N, N, K]
2488
+
2489
+ input_embeds = self.embed_tokens(input_ids)
2490
+ atom_metadata = self.metadata_vocab(input_ids)
2491
+ input_embeds = input_embeds + self.embed_metadata(atom_metadata) # [B, N, C]
2492
+
2493
+ attention_mask = (
2494
+ torch.cat(
2495
+ [
2496
+ torch.ones(
2497
+ attention_mask.size(0),
2498
+ 1,
2499
+ dtype=torch.bool,
2500
+ device=attention_mask.device,
2501
+ ),
2502
+ attention_mask.bool(),
2503
+ ],
2504
+ dim=1,
2505
+ )
2506
+ if attention_mask is not None
2507
+ else None
2508
+ )
2509
+
2510
+ attention_mask = (
2511
+ self._expand_mask(attention_mask, input_embeds.dtype, input_embeds.device)
2512
+ if attention_mask is not None
2513
+ else None
2514
+ )
2515
+
2516
+ for blk in self.blocks:
2517
+ input_embeds, pos_embeds = blk(input_embeds, pos_embeds, attention_mask)
2518
+
2519
+ return input_embeds, pos_embeds
2520
+
2521
+
2522
+ class AtomformerPreTrainedModel(PreTrainedModel): # type: ignore
2523
+ """Base class for all transformer models."""
2524
+
2525
+ config_class = AtomformerConfig
2526
+ base_model_prefix = "model"
2527
+ supports_gradient_checkpointing = True
2528
+ _no_split_modules = ["ParallelBlock"]
2529
+
2530
+ def _set_gradient_checkpointing(
2531
+ self, module: nn.Module, value: bool = False
2532
+ ) -> None:
2533
+ if isinstance(module, (AtomformerEncoder)):
2534
+ module.gradient_checkpointing = value
2535
+
2536
+
2537
+ class AtomformerModel(AtomformerPreTrainedModel):
2538
+ """Atomformer model for atom modeling."""
2539
+
2540
+ def __init__(self, config: AtomformerConfig):
2541
+ super().__init__(config)
2542
+ self.config = config
2543
+ self.encoder = AtomformerEncoder(config)
2544
+
2545
+ def forward(
2546
+ self,
2547
+ input_ids: torch.Tensor,
2548
+ coords: torch.Tensor,
2549
+ attention_mask: Optional[torch.Tensor] = None,
2550
+ ) -> torch.Tensor:
2551
+ """Forward function call for the transformer model."""
2552
+ output: torch.Tensor = self.encoder(input_ids, coords, attention_mask)
2553
+ return output
2554
+
2555
+
2556
+ class AtomformerForMaskedAM(AtomformerPreTrainedModel):
2557
+ """Atomformer with an atom modeling head on top for masked atom modeling."""
2558
+
2559
+ def __init__(self, config: AtomformerConfig):
2560
+ super().__init__(config)
2561
+ self.config = config
2562
+ self.encoder = AtomformerEncoder(config)
2563
+ self.am_head = nn.Linear(config.dim, config.vocab_size, bias=False)
2564
+
2565
+ def forward(
2566
+ self,
2567
+ input_ids: torch.Tensor,
2568
+ coords: torch.Tensor,
2569
+ labels: Optional[torch.Tensor] = None,
2570
+ fixed: Optional[torch.Tensor] = None,
2571
+ attention_mask: Optional[torch.Tensor] = None,
2572
+ ) -> Tuple[Optional[torch.Tensor], torch.Tensor]:
2573
+ """Forward function call for the masked atom modeling model."""
2574
+ hidden_states = self.encoder(input_ids, coords, attention_mask)
2575
+ logits = self.am_head(hidden_states)
2576
+
2577
+ loss = None
2578
+ if labels is not None:
2579
+ loss_fct = nn.CrossEntropyLoss()
2580
+ logits, labels = logits.view(-1, self.config.vocab_size), labels.view(-1)
2581
+ loss = loss_fct(logits, labels)
2582
+
2583
+ return loss, logits
2584
+
2585
+
2586
+ class AtomformerForCoordinateAM(AtomformerPreTrainedModel):
2587
+ """Atomformer with an atom coordinate head on top for coordinate denoising."""
2588
+
2589
+ def __init__(self, config: AtomformerConfig):
2590
+ super().__init__(config)
2591
+ self.config = config
2592
+ self.encoder = AtomformerEncoder(config)
2593
+ self.coords_head = nn.Linear(config.dim, 3)
2594
+
2595
+ def forward(
2596
+ self,
2597
+ input_ids: torch.Tensor,
2598
+ coords: torch.Tensor,
2599
+ labels_coords: Optional[torch.Tensor] = None,
2600
+ fixed: Optional[torch.Tensor] = None,
2601
+ attention_mask: Optional[torch.Tensor] = None,
2602
+ ) -> Tuple[Optional[torch.Tensor], torch.Tensor]:
2603
+ """Forward function call for the coordinate atom modeling model."""
2604
+ hidden_states = self.encoder(input_ids, coords, attention_mask)
2605
+ coords_pred = self.coords_head(hidden_states)
2606
+
2607
+ loss = None
2608
+ if labels_coords is not None:
2609
+ labels_coords = labels_coords.to(coords_pred.device)
2610
+ loss_fct = nn.L1Loss()
2611
+ loss = loss_fct(coords_pred, labels_coords)
2612
+
2613
+ return loss, coords_pred
2614
+
2615
+
2616
+ class InitialStructure2RelaxedStructure(AtomformerPreTrainedModel):
2617
+ """Atomformer with an coordinate head on top for relaxed structure prediction."""
2618
+
2619
+ def __init__(self, config: AtomformerConfig):
2620
+ super().__init__(config)
2621
+ self.config = config
2622
+ self.encoder = AtomformerEncoder(config)
2623
+ self.coords_head = nn.Linear(config.dim, 3)
2624
+
2625
+ def forward(
2626
+ self,
2627
+ input_ids: torch.Tensor,
2628
+ coords: torch.Tensor,
2629
+ labels_coords: Optional[torch.Tensor] = None,
2630
+ fixed: Optional[torch.Tensor] = None,
2631
+ attention_mask: Optional[torch.Tensor] = None,
2632
+ ) -> Tuple[Optional[torch.Tensor], torch.Tensor]:
2633
+ """Forward function call.
2634
+
2635
+ Initial structure to relaxed structure model.
2636
+ """
2637
+ hidden_states = self.encoder(input_ids, coords, attention_mask)
2638
+ coords_pred = self.coords_head(hidden_states)
2639
+
2640
+ loss = None
2641
+ if labels_coords is not None:
2642
+ labels_coords = labels_coords.to(coords_pred.device)
2643
+ loss_fct = nn.L1Loss()
2644
+ loss = loss_fct(coords_pred, labels_coords)
2645
+
2646
+ return loss, coords_pred
2647
+
2648
+
2649
+ class InitialStructure2RelaxedEnergy(AtomformerPreTrainedModel):
2650
+ """Atomformer with an energy head on top for relaxed energy prediction."""
2651
+
2652
+ def __init__(self, config: AtomformerConfig):
2653
+ super().__init__(config)
2654
+ self.config = config
2655
+ self.encoder = AtomformerEncoder(config)
2656
+ self.energy_norm = nn.LayerNorm(config.dim)
2657
+ self.energy_head = nn.Linear(config.dim, 1, bias=False)
2658
+
2659
+ def forward(
2660
+ self,
2661
+ input_ids: torch.Tensor,
2662
+ coords: torch.Tensor,
2663
+ labels_energy: Optional[torch.Tensor] = None,
2664
+ fixed: Optional[torch.Tensor] = None,
2665
+ attention_mask: Optional[torch.Tensor] = None,
2666
+ ) -> Tuple[Optional[torch.Tensor], torch.Tensor]:
2667
+ """Forward function call for the relaxed energy prediction model."""
2668
+ hidden_states = self.encoder(input_ids, coords, attention_mask)
2669
+ energy = self.energy_head(self.energy_norm(hidden_states[:, 0])).squeeze(-1)
2670
+
2671
+ loss = None
2672
+ if labels_energy is not None:
2673
+ loss_fct = nn.L1Loss()
2674
+ loss = loss_fct(energy, labels_energy)
2675
+
2676
+ return loss, energy
2677
+
2678
+
2679
+ class InitialStructure2RelaxedStructureAndEnergy(AtomformerPreTrainedModel):
2680
+ """Atomformer with an coordinate and energy head."""
2681
+
2682
+ def __init__(self, config: AtomformerConfig):
2683
+ super().__init__(config)
2684
+ self.config = config
2685
+ self.encoder = AtomformerEncoder(config)
2686
+ self.energy_norm = nn.LayerNorm(config.dim)
2687
+ self.energy_head = nn.Linear(config.dim, 1, bias=False)
2688
+ self.coords_head = nn.Linear(config.dim, 3)
2689
+
2690
+ def forward(
2691
+ self,
2692
+ input_ids: torch.Tensor,
2693
+ coords: torch.Tensor,
2694
+ labels_coords: Optional[torch.Tensor] = None,
2695
+ forces: Optional[torch.Tensor] = None,
2696
+ total_energy: Optional[torch.Tensor] = None,
2697
+ formation_energy: Optional[torch.Tensor] = None,
2698
+ has_formation_energy: Optional[torch.Tensor] = None,
2699
+ attention_mask: Optional[torch.Tensor] = None,
2700
+ ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
2701
+ """Forward function call for the relaxed structure and energy model."""
2702
+ atom_hidden_states, pos_hidden_states = self.encoder(
2703
+ input_ids, coords, attention_mask
2704
+ )
2705
+
2706
+ formation_energy_pred = self.formation_energy_head(
2707
+ self.energy_norm(atom_hidden_states[:, 0])
2708
+ ).squeeze(-1)
2709
+ loss_formation_energy = None
2710
+ if formation_energy is not None:
2711
+ loss_fct = nn.L1Loss()
2712
+ loss_formation_energy = loss_fct(
2713
+ formation_energy_pred[has_formation_energy],
2714
+ formation_energy[has_formation_energy],
2715
+ )
2716
+ coords_pred = self.coords_head(atom_hidden_states[:, 1:])
2717
+ loss_coords = None
2718
+ if labels_coords is not None:
2719
+ loss_fct = nn.L1Loss()
2720
+ loss_coords = loss_fct(coords_pred, labels_coords)
2721
+
2722
+ loss = torch.Tensor(0).to(coords.device)
2723
+ loss = (
2724
+ loss + loss_formation_energy if loss_formation_energy is not None else loss
2725
+ )
2726
+ loss = loss + loss_coords if loss_coords is not None else loss
2727
+
2728
+ return loss, (formation_energy_pred, coords_pred)
2729
+
2730
+
2731
+ class Structure2Energy(AtomformerPreTrainedModel):
2732
+ """Atomformer with an atom modeling head on top for masked atom modeling."""
2733
+
2734
+ def __init__(self, config: AtomformerConfig):
2735
+ super().__init__(config)
2736
+ self.config = config
2737
+ self.encoder = AtomformerEncoder(config)
2738
+ self.energy_norm = nn.LayerNorm(config.dim)
2739
+ self.formation_energy_head = nn.Linear(config.dim, 1, bias=False)
2740
+
2741
+ def forward(
2742
+ self,
2743
+ input_ids: torch.Tensor,
2744
+ coords: torch.Tensor,
2745
+ forces: Optional[torch.Tensor] = None,
2746
+ total_energy: Optional[torch.Tensor] = None,
2747
+ formation_energy: Optional[torch.Tensor] = None,
2748
+ has_formation_energy: Optional[torch.Tensor] = None,
2749
+ attention_mask: Optional[torch.Tensor] = None,
2750
+ ) -> Tuple[Optional[torch.Tensor], Tuple[torch.Tensor, Optional[torch.Tensor]]]:
2751
+ """Forward function call for the structure to energy model."""
2752
+ atom_hidden_states, pos_hidden_states = self.encoder(
2753
+ input_ids, coords, attention_mask
2754
+ )
2755
+
2756
+ formation_energy_pred: torch.Tensor = self.formation_energy_head(
2757
+ self.energy_norm(atom_hidden_states[:, 0])
2758
+ ).squeeze(-1)
2759
+ loss = torch.Tensor(0).to(coords.device)
2760
+ if formation_energy is not None:
2761
+ loss_fct = nn.L1Loss()
2762
+ loss = loss_fct(
2763
+ formation_energy_pred[has_formation_energy],
2764
+ formation_energy[has_formation_energy],
2765
+ )
2766
+
2767
+ return loss, (
2768
+ formation_energy_pred,
2769
+ attention_mask.bool() if attention_mask is not None else None,
2770
+ )
2771
+
2772
+
2773
+ class Structure2Forces(AtomformerPreTrainedModel):
2774
+ """Atomformer with a forces head on top for forces prediction."""
2775
+
2776
+ def __init__(self, config: AtomformerConfig):
2777
+ super().__init__(config)
2778
+ self.config = config
2779
+ self.encoder = AtomformerEncoder(config)
2780
+ self.force_norm = nn.LayerNorm(config.dim)
2781
+ self.force_head = nn.Linear(config.dim, 3)
2782
+ self.energy_norm = nn.LayerNorm(config.dim)
2783
+ self.formation_energy_head = nn.Linear(config.dim, 1, bias=False)
2784
+
2785
+ def forward(
2786
+ self,
2787
+ input_ids: torch.Tensor,
2788
+ coords: torch.Tensor,
2789
+ forces: Optional[torch.Tensor] = None,
2790
+ total_energy: Optional[torch.Tensor] = None,
2791
+ formation_energy: Optional[torch.Tensor] = None,
2792
+ has_formation_energy: Optional[torch.Tensor] = None,
2793
+ attention_mask: Optional[torch.Tensor] = None,
2794
+ ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, Optional[torch.Tensor]]]:
2795
+ """Forward function call for the structure to forces model."""
2796
+ atom_hidden_states, pos_hidden_states = self.encoder(
2797
+ input_ids, coords, attention_mask
2798
+ )
2799
+ attention_mask = attention_mask.bool() if attention_mask is not None else None
2800
+
2801
+ forces_pred: torch.Tensor = self.force_head(
2802
+ self.force_norm(atom_hidden_states[:, 1:])
2803
+ )
2804
+ loss = torch.Tensor(0).to(coords.device)
2805
+ if forces is not None:
2806
+ loss_fct = nn.L1Loss()
2807
+ loss = loss_fct(forces_pred[attention_mask], forces[attention_mask])
2808
+
2809
+ return loss, (
2810
+ forces_pred,
2811
+ attention_mask if attention_mask is not None else None,
2812
+ )
2813
+
2814
+
2815
+ class Structure2EnergyAndForces(AtomformerPreTrainedModel):
2816
+ """Atomformer with an energy and forces head for energy and forces prediction."""
2817
+
2818
+ def __init__(self, config: AtomformerConfig):
2819
+ super().__init__(config)
2820
+ self.config = config
2821
+ self.encoder = AtomformerEncoder(config)
2822
+ self.force_norm = nn.LayerNorm(config.dim)
2823
+ self.force_head = nn.Linear(config.dim, 3)
2824
+ self.energy_norm = nn.LayerNorm(config.dim)
2825
+ self.formation_energy_head = nn.Linear(config.dim, 1, bias=False)
2826
+
2827
+ def forward(
2828
+ self,
2829
+ input_ids: torch.Tensor,
2830
+ coords: torch.Tensor,
2831
+ forces: Optional[torch.Tensor] = None,
2832
+ total_energy: Optional[torch.Tensor] = None,
2833
+ formation_energy: Optional[torch.Tensor] = None,
2834
+ has_formation_energy: Optional[torch.Tensor] = None,
2835
+ attention_mask: Optional[torch.Tensor] = None,
2836
+ ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor, Optional[torch.Tensor]]]:
2837
+ """Forward function call for the structure to energy and forces model."""
2838
+ atom_hidden_states, pos_hidden_states = self.encoder(
2839
+ input_ids, coords, attention_mask
2840
+ )
2841
+
2842
+ formation_energy_pred: torch.Tensor = self.formation_energy_head(
2843
+ self.energy_norm(atom_hidden_states[:, 0])
2844
+ ).squeeze(-1)
2845
+ loss_formation_energy = None
2846
+ if formation_energy is not None:
2847
+ loss_fct = nn.L1Loss()
2848
+ loss_formation_energy = loss_fct(
2849
+ formation_energy_pred[has_formation_energy],
2850
+ formation_energy[has_formation_energy],
2851
+ )
2852
+ attention_mask = attention_mask.bool() if attention_mask is not None else None
2853
+ forces_pred: torch.Tensor = self.force_head(
2854
+ self.force_norm(atom_hidden_states[:, 1:])
2855
+ )
2856
+ loss_forces = None
2857
+ if forces is not None:
2858
+ loss_fct = nn.L1Loss()
2859
+ loss_forces = loss_fct(forces_pred[attention_mask], forces[attention_mask])
2860
+
2861
+ loss = torch.Tensor(0).to(coords.device)
2862
+ loss = (
2863
+ loss + loss_formation_energy if loss_formation_energy is not None else loss
2864
+ )
2865
+ loss = loss + loss_forces if loss_forces is not None else loss
2866
+
2867
+ return loss, (formation_energy_pred, forces_pred, attention_mask)