Open florian-huber opened 7 months ago
To make things more user friendly, we could simply merge the EmbeddingEvaluator and the Linear Model into the SiameseSpectralModel.
encoder
, which would allow people to only call the encoder to get embeddings but also embedding evaluationsMS2DeepScore
class which will output only scores when no EmbeddingEvaluator and LinearModel are present. (Or we keep two separate matchms-compatible classes like it is now. MS2DeepScoreEvaluated
would then raise an exception if the two additional models are missing.)My first idea was actually to keep the EmbeddingEvaluator and the LinearModel as separate classes, but to save them to the same file. However, I like the idea of having the option to just calculate embeddings and embedding evalutations. Saving and loading them in one file would reduce the risk of accidental mismatching models that are not compatible. But it could also be confusing to have multiple models stored in one file...
To make this possible we would need to save the embedding_evaluator_state_dict and the ms2deepscore_state_dict under separate keys and during loading use the state dict for each. For the EmbeddingEvaluator I would make it only possible to save to an already existing file that already contains the MS2Deepscore model (you need that model anyway).
With #201 we have 3 different models for different steps, which can be confusing. @niekdejonge proposed to consider ways of merging them into one class.