File size: 4,513 Bytes
1fa4f64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09ad38c
 
 
 
 
 
 
e9946fe
09ad38c
 
 
 
 
 
 
 
 
 
6d7d8d8
 
09ad38c
6d7d8d8
09ad38c
 
 
 
 
 
 
6d7d8d8
09ad38c
 
 
6d7d8d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09ad38c
 
 
 
f168c24
09ad38c
 
 
0e39c18
1fa4f64
6d7d8d8
 
 
637f16f
1fa4f64
 
 
 
09ad38c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fa4f64
 
 
 
 
 
 
 
 
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
---
license: cc-by-4.0
tags:
- science
- material
- inverse
- design
size_categories:
- 10M<n<100M
---

<div align="center">
  <img src="https://huggingface.co/datasets/HZBSolarOptics/shared-assets/raw/main/optollama.svg" style="height: 300px;">
</div>

# OptoLlama Dataset

[![License](https://img.shields.io/badge/Licenses-CC_BY_4.0-green)](./LICENSE)
[![Contact](https://img.shields.io/badge/Contact-SEAOPT-blue)](mailto:SE-AOPT-office@helmholtz-berlin.de)

## Details

The original dataset can be found in the [OptoGPT publication πŸ“](https://arxiv.org/abs/2304.10294) and here on [HuggingFace](https://huggingface.co/datasets/mataigao/optogpt_data).

**Key Enhancements**

- Inclusion of an **absorption** feature in the model βž•πŸ“ˆ
- Increased the **wave length** range to 300-2,000nm πŸ’‘

## Structure

```
β”œβ”€β”€ materials/
β”‚   β”œβ”€β”€ Ag.csv
β”‚   β”œβ”€β”€ Al.csv
β”‚   β”œβ”€β”€ ...
β”‚   └── ZnSe.csv
β”œβ”€β”€ train/
β”‚   β”œβ”€β”€ train-0.safetensors
β”‚   β”œβ”€β”€ train-1.safetensors
β”‚   β”œβ”€β”€ ...
β”‚   └── train-9.safetensors
β”œβ”€β”€ test/
β”‚   └── test.safetensors
└── tokens.json
```

Each `*.safetensors` file contains 1 million thin film structures (indexed by `tokens.json`) as well as their simulated absorption, reflection and transmission (RAT) spectrum. 

The spectrum tensors have the shape *(n_samples, 3 [RAT], 171 [bins],)* and are stored in `float16`. The thin film layers have the shape *(n_samples, 21 [max_depth incl. EOS and PAD],)* and are stored as `long`.

The thin film layer sequence is ordered from top to bottom, i.e., the lowest index is the top of the thin film layers (touches the air), and the highest index is the bottom layer (touching the back substrate). 

## Loading Data

This shows an example on how to load (a subset) of the entire data

```python
from safetensors.torch import load_file

data = load_file("train/train-0.safetensors")

spectra = data['spectra']
thin_films = data['thin_films']
print(spectra.shape, thin_films.shape)

>>> torch.Size([1000000, 3, 171]) torch.Size([1000000, 21])
```


## Details

- All spectra have been simulated with [tmm_fast](https://github.com/MLResearchAtOSRAM/tmm_fast)
- The *n* (refractive index), *k* (extinction coefficients) and *wl* (wavelength) of all materials can be found in CSV files in the `/materials` folder
- The training and test data are pre-split and can be found in the `/train` and `/test` folder respectively
- A full list of the vocabular, i.e., all possible tokens, can be found in the `tokens.json`, with the the format of `<material>_<thickness_in_nm>`
- There are additional tokens for end of sequences (EOS), padding (PAD) and masking (MASK)
- We offer a sub-samples version of the entire test dataset called cropped

| Train samples   | Test samples | Test samples (cropped) |
| --------------: | -----------: | ---------------------: |
|      10,000,000 |    1,000,000 |                128,000 |

## Acknowledgements

This work is supported by the Helmholtz Association Initiative and Networking Fund through the Helmholtz AI platform, and the HAICORE@KIT grant.

## Citations

If you find our work helpful, please feel free to cite as following:

```
@article{ma2024optogpt,
  title={OptoGPT: a foundation model for inverse design in optical multilayer thin film structures},
  author={Ma, Taigao and Wang, Haozhu and Guo, L Jay},
  journal={Opto-Electronic Advances},
  volume={7},
  number={7},
  year={2024},
  publisher={Opto-Electronic Advance},
  doi={10.29026/oea.2024.240062}
}
```

----

<div style="float: left; position: relative; left: 50%; transform: translateX(-50%);">
  <a href="https://www.helmholtz-berlin.de/index_en.html"></a><img src="https://huggingface.co/datasets/HZBSolarOptics/shared-assets/raw/main/logo_hzb.svg" style="height: 80px; float: left; margin: 0 1em"></a>
  <a href="https://www.kit.edu/english/index.php"></a><img src="https://huggingface.co/datasets/HZBSolarOptics/shared-assets/raw/main/logo_kit.svg" style="height: 80px; float: left; margin: 0 1em"></a>
  <a href="https://www.zib.de/"></a><img src="https://huggingface.co/datasets/HZBSolarOptics/shared-assets/resolve/main/logo_zib.png" style="height: 80px; float: left; margin: 0 1em"></a>

  <a href="https://www.helmholtz.ai/"></a><img src="https://huggingface.co/datasets/HZBSolarOptics/shared-assets/raw/main/logo_hai.svg" style="height: 20px; float: left; margin: 2em 0; position: relative; left: 50%; transform: translateX(-50%);"></a>
</div>