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
41
42
43
44
45
  1. import json
  2. import os
  3. import git
  4. from dagshub import DAGsHubLogger
  5. logger = DAGsHubLogger()
  6. desk = [80,90]
  7. cell = [50,60]
  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. try:
  17. open_json_file = open(par_file_path, 'r', encoding='utf-8')
  18. par_dict = json.load(open_json_file)
  19. open_json_file.close()
  20. except:
  21. par_dict = {}
  22. par_dict['desk'] = 100
  23. par_dict['cell'] = 80
  24. par_dict['obj_cof_0'] = obj_elements_0
  25. par_dict['obj_cof_1'] = obj_elements_1
  26. open_json_file = open(par_file_path, 'w', encoding='utf-8')
  27. json.dump(par_dict,open_json_file)
  28. open_json_file.close()
  29. commit_string = "Test Logger Commit for {} desk and {} cell".format(obj_elements_0,obj_elements_1)
  30. os.system('dvc status')
  31. repo.git.add(par_file_path)
  32. repo.git.commit('-m', commit_string)
  33. 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...