pluskal-lab / MassSpecGym

MassSpecGym: A benchmark for the discovery and identification of molecules
MIT License
9 stars 3 forks source link

Use self.hparams for hyperparameters #14

Closed adamoyoung closed 3 weeks ago

adamoyoung commented 3 months ago

https://github.com/pluskal-lab/MassSpecGym/blob/2d16eb959a023a15cd0e485888415465789df20e/massspecgym/models/base.py#L12-L14

Can we just use self.save_hyperparameters() then reference these variables with self.hparams? This is standard practice in PL.

I would propose changing it to:

super().__init__(**kwargs)
self.save_hyperparameters()
anton-bushuiev commented 3 months ago

Yes, I think this is a good idea

adamoyoung commented 3 months ago

I've implemented this in my own branch, when we merge I will try to fix it elsewhere

anton-bushuiev commented 3 months ago

Thank you!

anton-bushuiev commented 3 weeks ago

I have also added this to the main branch now: https://github.com/pluskal-lab/MassSpecGym/blob/d67eeb35bb3b068d8c47109a5bc416bbffcf42c7/massspecgym/models/base.py#L37C9-L37C36

adamoyoung commented 3 weeks ago

lmao I reworked my branch to not use it anymore 🙃 will change it back