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

Thread safety #29

Open
alexpghayes opened this issue Sep 18, 2018 · 1 comment
Open

Thread safety #29

alexpghayes opened this issue Sep 18, 2018 · 1 comment

Comments

@alexpghayes
Copy link

This is awesome! It would be cool if there were some thread-safe way to update the leaderboard to facilitate training multiple models in parallel. Not sure what the best way to go about that would be.

@tmastny
Copy link
Owner

tmastny commented Sep 18, 2018

This and other ideas prompted this very long and fruitful discussion in ropensci/drake#376.

Basically I would wait until all the models are fitted before running board. Using this example:

model_plan <- drake_plan(
  data = get_data(),
  informal_look = inspect_data(data, mu = mu__, rep = rep__),
  bayes_model = bayesian_model_fit(data, prior_mu = mu__, rep = rep__)
) %>%
  evaluate_plan(
    rules = list(
      mu__ = c(3, 9),
      rep__ = 1:2
    ),
    trace = TRUE
  ) %>%
  gather_by(mu__, mu___from)

results_plan <- drake_plan(
  walk(target_3_bayes_model, board); file_out("leadrboard.RDS")
)

plan <- bind_plans(model_plan, results_plan)

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

No branches or pull requests

2 participants