Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hotstart #874

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

feat: hotstart #874

wants to merge 5 commits into from

Conversation

be-marc
Copy link
Member

@be-marc be-marc commented Feb 7, 2025

Nothing to merge yet but a poc we should discuss. mlr3tuning is ready to use hotstarting efficiently and @sebffischer wants to use hotstarting for torch. This currently only works for pipelines that are deterministic until the hotstart model is reached.

Further thoughts on this. Actually, the task would no longer have to be sent through the pipeline during hotstarting. If you cache the task before the hotstart model, you can simply continue there. However, this would somehow require the task to be cached at this point during the first training.

@be-marc
Copy link
Member Author

be-marc commented Feb 7, 2025

library(mlr3pipelines)
library(mlr3tuning)
library(mlr3learners)

task = tsk("german_credit")
resampling = rsmp("cv", folds = 3)
resampling$instantiate(task)

learner = as_learner(po("encodeimpact") %>>% lrn("classif.xgboost", nrounds = 3))

rr = resample(task, learner, resampling, store_models = TRUE)
rr$score(msr("classif.acc"))
rr$learners[[1]]$model$classif.xgboost

learner_2 = as_learner(po("encodeimpact") %>>% lrn("classif.xgboost", nrounds = 27))
learner_2$hotstart_stack = HotstartStack$new(rr$learners)

rr = resample(task, learner_2, resampling, store_models = TRUE, allow_hotstart = TRUE)
rr$score(msr("classif.acc"))
rr$learners[[1]]$model$classif.xgboost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant