rp_20M_cu_130426/gen.py CHANGED
@@ -26,7 +26,7 @@ dataset = LEGODataset(
26
  ntokens = dataset.target.shape[1] + 2 # +1 for e_dep, +1 for density
27
 
28
  pdgids = dataset.target[..., -1].flatten().nan_to_num().unique()
29
- pdgids = pdgids[(0 < pdgids.abs()) & (pdgids.abs() < 1000000000)].tolist()
30
 
31
  meta_dict = {
32
  "ntokens": ntokens,
@@ -38,69 +38,13 @@ with open("meta.json", "w") as f:
38
  json.dump(meta_dict, f, ensure_ascii=True, indent=4)
39
 
40
  config = {
41
- "base_conf": {
42
- "base_range": 3.4,
43
- "kappa": torch.tensor(8.),
44
- "bs_frac": 0.,
45
- "base_dist": "poles",
46
- "scale_dist": "sm_norm"
47
- },
48
- "model_conf": {
49
- "manifold": "ProductManifold([Euclidean(), Sphere()], (3, 3))",
50
- "proj_ray": True,
51
- "ot_coupling": True,
52
- "proj_en": "in_frac_log",
53
- "t_dist": "sm_norm",
54
- "loss_sc": 0.,
55
- "model_args": {
56
- "h_dim": 2**8,
57
- "in_dim": 6,
58
- "nlayers": 4,
59
- "nhead": 4,
60
- "dropout": 0.02,
61
- "ff_mult": 2,
62
- "use_adaptive_rmsnorm": True,
63
- "use_adaptive_layerscale": True,
64
- "ff_swish": True,
65
- "ff_glu": True,
66
- "ff_no_bias": False,
67
- "residual_attn": True,
68
- "attn_qk_norm": True,
69
- "attn_value_rmsnorm": True,
70
- },
71
- },
72
- "mm_conf": {
73
- "use_density": True,
74
- "dropout": 0.1,
75
- "h_dim": 128,
76
- "n_layers": 6,
77
- "n_heads": 6,
78
- "ff_mult": 4,
79
- "in_dim": 7,
80
- "bs": 2**12,
81
- "lr": 1e-3,
82
- "label_smoothing": 0.,
83
- "val_frac": 0.,
84
- "weight_decay": 0.01,
85
- "warmup_steps": 0,
86
- "ce_focal_gamma": 0.,
87
- "post_emb_norm": False,
88
- "abs_pos_emb": False,
89
- "model_args": {
90
- "ff_swish": True,
91
- "ff_glu": True,
92
- "attn_qk_norm": True,
93
- "rotary_xpos": True,
94
- "use_adaptive_rmsnorm": True,
95
- "use_adaptive_layerscale": True,
96
- "residual_attn": True,
97
- },
98
- },
99
  }
100
 
101
  dprep = DataPrep(config)
102
  data_prepped = dprep.prep(dataset.full_data)
103
- torch.save(data_prepped, "data_prepped.pt")
104
-
105
- # mloader = MultLoader("data_prepped.pt", max_particles=ntokens, use_density=True)
106
- # torch.save((mloader.input, mloader.counts, mloader.pdgid_in_idx), "data_mult_prepped.pt")
 
26
  ntokens = dataset.target.shape[1] + 2 # +1 for e_dep, +1 for density
27
 
28
  pdgids = dataset.target[..., -1].flatten().nan_to_num().unique()
29
+ pdgids = pdgids[(0 != pdgids) & (pdgids.abs() < 1_000_000_000)].tolist()
30
 
31
  meta_dict = {
32
  "ntokens": ntokens,
 
38
  json.dump(meta_dict, f, ensure_ascii=True, indent=4)
39
 
40
  config = {
41
+ "model_conf": {
42
+ "manifold": "ProductManifold([Euclidean(), Sphere()], (3, 3))",
43
+ "proj_en": "in_frac_log",
44
+ "model_args": {"in_dim": 6},
45
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  dprep = DataPrep(config)
49
  data_prepped = dprep.prep(dataset.full_data)
50
+ torch.save(data_prepped, "data_prepped.pt")
 
 
 
rp_mult_eg_density_020426/gen.py CHANGED
@@ -20,7 +20,7 @@ dataset = LEGODataset(
20
  ntokens = dataset.target.shape[1] + 2 # +1 for e_dep, +1 for density
21
 
22
  pdgids = dataset.target[..., -1].flatten().nan_to_num().unique()
23
- pdgids = pdgids[(0 < pdgids.abs()) & (pdgids.abs() < 1000000000)].tolist()
24
 
25
  meta_dict = {
26
  "ntokens": ntokens,
@@ -32,64 +32,11 @@ with open("meta.json", "w") as f:
32
  json.dump(meta_dict, f, ensure_ascii=True, indent=4)
33
 
34
  config = {
35
- "base_conf": {
36
- "base_range": 3.4,
37
- "kappa": torch.tensor(8.),
38
- "bs_frac": 0.,
39
- "base_dist": "poles",
40
- "scale_dist": "sm_norm"
41
- },
42
- "model_conf": {
43
- "manifold": "ProductManifold([Euclidean(), Sphere()], (3, 3))",
44
- "proj_ray": True,
45
- "ot_coupling": True,
46
- "proj_en": "in_frac_log",
47
- "t_dist": "sm_norm",
48
- "loss_sc": 0.,
49
- "model_args": {
50
- "h_dim": 2**8,
51
- "in_dim": 6,
52
- "nlayers": 4,
53
- "nhead": 4,
54
- "dropout": 0.02,
55
- "ff_mult": 2,
56
- "use_adaptive_rmsnorm": True,
57
- "use_adaptive_layerscale": True,
58
- "ff_swish": True,
59
- "ff_glu": True,
60
- "ff_no_bias": False,
61
- "residual_attn": True,
62
- "attn_qk_norm": True,
63
- "attn_value_rmsnorm": True,
64
- },
65
- },
66
- "mm_conf": {
67
- "use_density": True,
68
- "dropout": 0.1,
69
- "h_dim": 128,
70
- "n_layers": 6,
71
- "n_heads": 6,
72
- "ff_mult": 4,
73
- "in_dim": 7,
74
- "bs": 2**12,
75
- "lr": 1e-3,
76
- "label_smoothing": 0.,
77
- "val_frac": 0.,
78
- "weight_decay": 0.01,
79
- "warmup_steps": 0,
80
- "ce_focal_gamma": 0.,
81
- "post_emb_norm": False,
82
- "abs_pos_emb": False,
83
- "model_args": {
84
- "ff_swish": True,
85
- "ff_glu": True,
86
- "attn_qk_norm": True,
87
- "rotary_xpos": True,
88
- "use_adaptive_rmsnorm": True,
89
- "use_adaptive_layerscale": True,
90
- "residual_attn": True,
91
- },
92
- },
93
  }
94
 
95
  dprep = DataPrep(config)
 
20
  ntokens = dataset.target.shape[1] + 2 # +1 for e_dep, +1 for density
21
 
22
  pdgids = dataset.target[..., -1].flatten().nan_to_num().unique()
23
+ pdgids = pdgids[(0 != pdgids) & (pdgids.abs() < 1_000_000_000)].tolist()
24
 
25
  meta_dict = {
26
  "ntokens": ntokens,
 
32
  json.dump(meta_dict, f, ensure_ascii=True, indent=4)
33
 
34
  config = {
35
+ "model_conf": {
36
+ "manifold": "ProductManifold([Euclidean(), Sphere()], (3, 3))",
37
+ "proj_en": "in_frac_log",
38
+ "model_args": {"in_dim": 6},
39
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  dprep = DataPrep(config)