cjpcool commited on
Commit
fb79336
·
verified ·
1 Parent(s): 8b2f5d6

Delete meta_modulus.py

Browse files
Files changed (1) hide show
  1. meta_modulus.py +0 -71
meta_modulus.py DELETED
@@ -1,71 +0,0 @@
1
- import datasets
2
- import torch
3
- from torch_geometric.data import Data
4
-
5
-
6
- _CITATION = """\
7
- @article{metamatbench,
8
- title={MetamatBench: Integrating Heterogeneous Data, Computational Tools, and Visual Interface for Metamaterial Discovery},
9
- author={Chen, Jianpeng and Zhan, Wangzhi and Wang, Haohui and Jia, Zian and Gan, Jingru and Zhang, Junkai and Qi, Jingyuan and Chen, Tingwei and Huang, Lifu and Chen, Muhao and others},
10
- journal={arXiv preprint arXiv:2505.20299},
11
- year={2025}
12
- }
13
- """
14
-
15
- _DESCRIPTION = """
16
- This dataset contains lattice structure data for predicting modulus properties, preprocessed into PyTorch Geometric (PyG) compatible format.
17
- """
18
-
19
-
20
- class LatticeModulusDataset(datasets.GeneratorBasedBuilder):
21
- BUILDER_CONFIGS = [
22
- datasets.BuilderConfig(name="default", version=datasets.Version("1.0.0")),
23
- ]
24
- def _info(self):
25
- return datasets.DatasetInfo(
26
- description=_DESCRIPTION,
27
- citation=_CITATION,
28
- features=datasets.Features({
29
- 'frac_coords': datasets.Array2D(shape=(None, 3), dtype='float32'),
30
- 'cart_coords': datasets.Array2D(shape=(None, 3), dtype='float32'),
31
- 'node_feat': datasets.Array2D(shape=(None, 4), dtype='float32'),
32
- 'node_type': datasets.Sequence(datasets.Value('int64')),
33
- 'edge_feat': datasets.Array2D(shape=(None, 1), dtype='float32'),
34
- 'edge_index': datasets.Array2D(shape=(2, None), dtype='int64'),
35
- 'lengths': datasets.Array2D(shape=(1, 3), dtype='float32'),
36
- 'num_nodes': datasets.Value('int64'),
37
- 'num_atoms': datasets.Value('int64'),
38
- 'angles': datasets.Array2D(shape=(1, 3), dtype='float32'),
39
- 'vector': datasets.Array2D(shape=(1, 9), dtype='float32'),
40
- 'y': datasets.Array2D(shape=(1, 12), dtype='float32'),
41
- 'young': datasets.Array2D(shape=(1, 3), dtype='float32'),
42
- 'shear': datasets.Array2D(shape=(1, 3), dtype='float32'),
43
- 'poisson': datasets.Array2D(shape=(1, 6), dtype='float32'),
44
- }),
45
- )
46
-
47
- def _split_generators(self, dl_manager):
48
- file_path = dl_manager.download_and_extract('data.pkl')
49
- return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={'filepath': file_path})]
50
-
51
- def _generate_examples(self, filepath):
52
- dataset = torch.load(filepath)
53
-
54
- for idx, data in enumerate(dataset):
55
- yield idx, {
56
- 'frac_coords': data.frac_coords.numpy(),
57
- 'cart_coords': data.cart_coords.numpy(),
58
- 'node_feat': data.node_feat.numpy(),
59
- 'node_type': data.node_type.numpy().tolist(),
60
- 'edge_feat': data.edge_feat.numpy(),
61
- 'edge_index': data.edge_index.numpy(),
62
- 'lengths': data.lengths.numpy(),
63
- 'num_nodes': data.num_nodes,
64
- 'num_atoms': data.num_atoms,
65
- 'angles': data.angles.numpy(),
66
- 'vector': data.vector.numpy(),
67
- 'y': data.y.numpy(),
68
- 'young': data.young.numpy(),
69
- 'shear': data.shear.numpy(),
70
- 'poisson': data.poisson.numpy(),
71
- }