Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

test_tune.py 920 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  1. import json
  2. import pytest
  3. import utils
  4. from madewithml import tune
  5. @pytest.mark.training
  6. def test_tune_models(dataset_loc):
  7. num_runs = 2
  8. experiment_name = utils.generate_experiment_name(prefix="test_tune")
  9. initial_params = [
  10. {
  11. "train_loop_config": {
  12. "dropout_p": 0.5,
  13. "lr": 1e-4,
  14. "lr_factor": 0.8,
  15. "lr_patience": 3,
  16. }
  17. }
  18. ]
  19. results = tune.tune_models(
  20. experiment_name=experiment_name,
  21. dataset_loc=dataset_loc,
  22. initial_params=json.dumps(initial_params),
  23. num_workers=6,
  24. cpu_per_worker=1,
  25. gpu_per_worker=0,
  26. num_runs=num_runs,
  27. num_epochs=1,
  28. num_samples=512,
  29. batch_size=256,
  30. results_fp=None,
  31. )
  32. utils.delete_experiment(experiment_name=experiment_name)
  33. assert len(results.get_dataframe()) == num_runs
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...