torch_ecg icon indicating copy to clipboard operation
torch_ecg copied to clipboard

Pretrained weights for various tasks

Open ItayMeiri opened this issue 6 months ago • 3 comments

Is it possible to add pretrained weights compatible with each model and a simple preprocessing requirement?

ItayMeiri avatar Jun 22 '25 16:06 ItayMeiri

For pretrained weights (models), currently, one can call the from_remote to download and load weights from somewhere on the internet. There are trained models (stored in Google Drive, Dropbox, my personal site, etc.), but I don't have one stable, universally accessible, cheap (free would be better) storage. Huggingface Hub is a good choice, but it is not integrated yet.

For simple preprocessing requirements, currently, the model weight tensors are packed and stored along with the training configs (a dict-like object). One can recover the preprocessing procedure from the configs. It would be better if we could recover the preprocessing procedure (an object PreProcessor) automatically from the config (say with some method from_config). This is partially done (as far as I remember). Another concern is that loading directly from some packed file (e.g., a pt file) containing things other than weight tensors is considered unsafe. So I'm thinking of a new model saving mechanism with safetensors, and better also along with the configs just like now.

wenh06 avatar Jun 24 '25 15:06 wenh06

For pretrained weights (models), currently, one can call the from_remote to download and load weights from somewhere on the internet. There are trained models (stored in Google Drive, Dropbox, my personal site, etc.), but I don't have one stable, universally accessible, cheap (free would be better) storage. Huggingface Hub is a good choice, but it is not integrated yet.

For simple preprocessing requirements, currently, the model weight tensors are packed and stored along with the training configs (a dict-like object). One can recover the preprocessing procedure from the configs. It would be better if we could recover the preprocessing procedure (an object PreProcessor) automatically from the config (say with some method from_config). This is partially done (as far as I remember). Another concern is that loading directly from some packed file (e.g., a pt file) containing things other than weight tensors is considered unsafe. So I'm thinking of a new model saving mechanism with safetensors, and better also along with the configs just like now.

Thanks for your reply @wenh06 !

Could we perhaps compile a list containing the various trained models weights for each model? For instance, you mentioned a website in #25 for ECG_SEQ_LAB_NET - perhaps we could do the same for all existing models, with a basic script/example data for each one.

ItayMeiri avatar Jun 29 '25 23:06 ItayMeiri

Thank you for your suggestion. The benchmark folder contains full pipelines training from scratch. Currently, there's no list of trained models and scripts/notebooks for using them. I will do this shortly.

wenh06 avatar Jul 02 '25 05:07 wenh06