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

hyperpar_tune.py 1.2 KB

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
38
39
40
  1. import json
  2. import os
  3. import git
  4. from dagshub import DAGsHubLogger
  5. logger = DAGsHubLogger()
  6. desk = [50,60]
  7. cell = [40,80]
  8. obj_cof_0 = [20,40]
  9. obj_cof_1 = [50,70]
  10. json_par_filename = 'pars.json'
  11. dir_path = os.path.dirname(os.path.realpath(__file__))
  12. par_file_path = os.path.join(dir_path,json_par_filename)
  13. repo = git.Repo(dir_path)
  14. for obj_elements_0 in obj_cof_0:
  15. for obj_elements_1 in obj_cof_0:
  16. par_dict = {}
  17. par_dict['desk'] = 100
  18. par_dict['cell'] = 80
  19. par_dict['obj_cof_0'] = obj_elements_0
  20. par_dict['obj_cof_1'] = obj_elements_1
  21. par_dict['Labels'] = "Testing a model with LP solver"
  22. logger.log_hyperparams(obj_cof_1=obj_elements_0)
  23. logger.log_hyperparams(obj_cof_1=obj_elements_1)
  24. logger.log_metrics({'element_a': obj_elements_0, 'element_b' : obj_elements_1, 'Label' : "Testing a model with LP solver" }, objective=100)
  25. commit_string = "Test Logger Commit for {} a and {} b".format(obj_elements_0,obj_elements_1)
  26. os.system('dvc status')
  27. repo.git.add(par_file_path)
  28. repo.git.commit('-m', commit_string)
  29. os.system('dvc repro simulation.dvc')
Tip!

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

Comments

Loading...