yzhouchen001 commited on
Commit
bb5c624
·
1 Parent(s): a7e75cf
app_utils/model_utils.py CHANGED
@@ -24,7 +24,7 @@ def load_model_components():
24
 
25
  # load model
26
 
27
- checkpoint_pth = "experiments/20250913_optimized_filip-model/epoch=1993-train_loss=0.10.ckpt"
28
  params['checkpoint_pth'] = checkpoint_pth
29
  model = get_model(params['model'], params)
30
 
 
24
 
25
  # load model
26
 
27
+ checkpoint_pth = "epoch=1993-train_loss=0.10.ckpt"
28
  params['checkpoint_pth'] = checkpoint_pth
29
  model = get_model(params['model'], params)
30
 
app_utils/upload_model.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+
3
+ api = HfApi()
4
+ api.upload_file(
5
+ path_or_fileobj="experiments/20250913_optimized_filip-model/epoch=1993-train_loss=0.10.ckpt",
6
+ path_in_repo="epoch=1993-train_loss=0.10.ckpt",
7
+ repo_id="yzhouchen001/flare",
8
+ repo_type="space", # automatically uses your saved token
9
+ use_auth_token=True
10
+ )
experiments/20250913_optimized_filip-model/lightning_logs/version_0/hparams.yaml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ lr: 2.881339661302105e-05
2
+ weight_decay: 1.1586679936312845e-05
3
+ log_only_loss_at_stages: []
4
+ bootstrap_metrics: true
5
+ df_test_path: /data/yzhouc01/FILIP-MS/experiments/20250913_optimized_filip-model/result.pkl
6
+ job_key: ''
7
+ run_name: optimized_filip-model
8
+ run_details: ''
9
+ project_name: ''
10
+ wandb_entity_name: mass-spec-ml
11
+ no_wandb: true
12
+ seed: 0
13
+ debug: false
14
+ checkpoint_pth: null
15
+ max_epochs: 2000
16
+ accelerator: gpu
17
+ devices:
18
+ - 1
19
+ log_every_n_steps: 250
20
+ val_check_interval: 1.0
21
+ candidates_pth: /r/hassounlab/spectra_data/msgym/molecules/MassSpecGym_retrieval_candidates_mass.json
22
+ dataset_pth: /r/hassounlab/spectra_data/msgym/MassSpecGym.tsv
23
+ subformula_dir_pth: /data/yzhouc01/MVP/data/MassSpecGym/data/subformulae_default
24
+ split_pth: null
25
+ fp_dir_pth: null
26
+ cons_spec_dir_pth: null
27
+ NL_spec_dir_pth: ''
28
+ partial_checkpoint: ''
29
+ batch_size: 64
30
+ contr_temp: 0.022772534845886608
31
+ early_stopping_patience: 300
32
+ loss_strategy: static
33
+ num_workers: 50
34
+ spectra_view: SpecFormula
35
+ formula_source: default
36
+ max_mz: 1000
37
+ bin_width: 1
38
+ mask_peak_ratio: 0.0
39
+ element_list:
40
+ - H
41
+ - C
42
+ - O
43
+ - 'N'
44
+ - P
45
+ - S
46
+ - Cl
47
+ - F
48
+ - Br
49
+ - I
50
+ - B
51
+ - As
52
+ - Si
53
+ - Se
54
+ add_intensities: true
55
+ mask_precursor: false
56
+ molecule_view: MolGraph
57
+ atom_feature: full
58
+ bond_feature: full
59
+ use_contr: false
60
+ contr_wt: 1
61
+ contr_wt_update: {}
62
+ use_cons_spec: false
63
+ cons_spec_wt: 3
64
+ cons_spec_wt_update: {}
65
+ cons_loss_type: l2
66
+ pred_fp: false
67
+ use_fp: false
68
+ fp_loss_type: cosine
69
+ fp_wt: 3
70
+ fp_wt_update: {}
71
+ fp_size: 1024
72
+ fp_radius: 5
73
+ fp_dropout: 0.4
74
+ aug_cands: false
75
+ aug_cands_wt: 0.1
76
+ aug_cands_update: {}
77
+ aug_cands_size: 3
78
+ use_NL: false
79
+ task: retrieval
80
+ spec_enc: Transformer_Formula
81
+ mol_enc: GNN
82
+ model: filipContrastive
83
+ contr_views:
84
+ - - spec_enc
85
+ - mol_enc
86
+ final_embedding_dim: 512
87
+ fc_dropout: 0.4
88
+ hidden_dims:
89
+ - 64
90
+ - 128
91
+ formula_dropout: 0.2
92
+ formula_dims:
93
+ - 512
94
+ - 256
95
+ - 512
96
+ cross_attn_heads: 2
97
+ use_cls: false
98
+ peak_dropout: 0.414425691950033
99
+ formula_attn_heads: 4
100
+ formula_transformer_layers: 2
101
+ attn_heads:
102
+ - 12
103
+ - 12
104
+ - 12
105
+ gnn_channels:
106
+ - 64
107
+ - 128
108
+ - 512
109
+ gnn_type: gcn
110
+ num_gnn_layers: 3
111
+ gnn_hidden_dim: 512
112
+ gnn_dropout: 0.23234950970370824
113
+ experiment_dir: /data/yzhouc01/FILIP-MS/experiments/20250913_optimized_filip-model
114
+ at_ks:
115
+ - 1
116
+ - 5
117
+ - 20
118
+ myopic_mces_kwargs: null