kyujinpy commited on
Commit
df41f4e
·
verified ·
1 Parent(s): 756bd12

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -0
README.md CHANGED
@@ -1,3 +1,77 @@
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
4
+
5
+ # SpecEncoder for Galaxy spectra🌕
6
+ GitHub: [GalaxySVLM](https://github.com/Marker-Inc-Korea/GalaxySVLM/tree/main/SpecEncoder)
7
+ Weight file: [specformer-epoch=440-val.ckpt]()
8
+
9
+ ## Hyperparameters
10
+ | Parameters | Value |
11
+ | --- | --- |
12
+ | Epoch | 500 |
13
+ | Batch | 512 |
14
+ | LR | 1e-4 |
15
+ | Scheduler | CosineAnnealingWithWarmupLR |
16
+ | Warmup_step | 1000 |
17
+ | Optimizer | AdamW |
18
+ > 2 NVIDIA RTX PRO 6000
19
+
20
+ ## *Data Preprocessing
21
+ 1. Flux (spectrum) Overlapping
22
+ ```python
23
+ def preprocess_flux(self, b_wave, r_wave, z_wave, b_flux, r_flux, z_flux):
24
+ '''
25
+ simple overlapping (kyuiin method.)
26
+ '''
27
+
28
+ # indices to keep
29
+ r_start = np.searchsorted(r_wave, b_wave[-1], side="right")
30
+ z_start = np.searchsorted(z_wave, r_wave[-1], side="right")
31
+
32
+ #print("Remove from R:", r_start)
33
+ #print("Remove from Z:", z_start)
34
+
35
+ wave = np.concatenate([
36
+ b_wave,
37
+ r_wave[r_start:],
38
+ z_wave[z_start:]
39
+ ])
40
+
41
+ flux = np.concatenate([
42
+ b_flux,
43
+ r_flux[r_start:],
44
+ z_flux[z_start:]
45
+ ])
46
+
47
+ #print("Final length:", len(wave))
48
+ assert len(wave)==7781, 'manually spectrum length 7781'
49
+
50
+ return wave, flux
51
+ ```
52
+
53
+ 2. Each Standardization
54
+ ```python
55
+ std, mean = x.std(1, keepdim=True).clip_(0.2), x.mean(1, keepdim=True)
56
+ x = (x - mean) / std
57
+ ```
58
+
59
+ 3. slicing
60
+ - Overlap length = 10
61
+ - window = 20
62
+
63
+ 4. Add standardization information (mean/std)
64
+ ```python
65
+ x = F.pad(x, pad=(2, 0, 1, 0), mode="constant", value=0)
66
+ x[:, 0, 0] = (mean.squeeze() - 2) / 2
67
+ x[:, 0, 1] = (std.squeeze() - 2) / 8
68
+ #print(x.shape) # (B, 778, 22)
69
+ ```
70
+
71
+ 5. masking (for self-supervised learning)
72
+ - mask_chunk_width: 50
73
+ - mask_num_chunks: 6
74
+
75
+
76
+ # Reference
77
+ - [AstroCLIP](https://github.com/PolymathicAI/AstroCLIP/tree/main)