scikit-learn-contrib / metric-learn

Metric learning algorithms in Python
http://contrib.scikit-learn.org/metric-learn/
MIT License
1.4k stars 233 forks source link

SCML: Add warm_start parameter #345

Open maxi-marufo opened 2 years ago

maxi-marufo commented 2 years ago

Because SCML optimization procedure is based on stochastic subgradient descent, we can save the weights after fitting the model, and use them in a following fit call (with a different set of triplets). The decision to use the warm_start parameter instead of a new partial_fit method is because partial_fit in scikit-learn will only fit 1 epoch, whereas fit will fit for multiple epochs (until the loss converges or max_iter is reached), which is the case also for SCML.

perimosocordiae commented 2 years ago

This change looks fine to me, though I'm not sure when this warm-start option is useful in practice. Sorry for the extreme delay in reviewing!

@grudloff want to take a look?

grudloff commented 2 years ago

LGTM!