Skip to content

Clarification on input normalization parameters when reloading trained scPred model #5

@bigbunny222

Description

@bigbunny222

Hi, thank you for the great scPred model implementation!

I have a question regarding the input normalization step during model training and prediction.
In the training script, standardization is done manually by computing the mean and standard deviation of the training data as follows:
train_mean = train_epi.mean(dim=0)
train_std = train_epi.std(dim=0)
train_epi = (train_epi - train_mean) / train_std
However, in Section 5* of the tutorial (“Re-load the trained model”), it is mentioned:

“When use the model to do new predictions, if you run the input normalization during the model training, use the same scaler of training data to normalize your new input data.”

Could you please clarify:

Is it necessary to manually save train_mean and train_std during training to apply the same normalization when making new predictions?

If so, do you have any recommended way to store and reuse those parameters (e.g., torch.save() or pickle)?

Would you consider adding this saving/loading process into the codebase or tutorial for reproducibility?

Thanks again for your help and for providing this model to the community!

Best regards,
Bunny

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions