aiauto-client 0.1.17__tar.gz → 0.1.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/PKG-INFO +3 -3
  2. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/README.md +2 -2
  3. aiauto_client-0.1.17/examples/simple_example.py → aiauto_client-0.1.19/examples/example_simple.py +7 -3
  4. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/examples/example_torch_multiple_objective.py +24 -4
  5. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/examples/example_torch_single_objective.py +18 -0
  6. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/pyproject.toml +1 -1
  7. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto_client.egg-info/PKG-INFO +3 -3
  8. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto_client.egg-info/SOURCES.txt +1 -1
  9. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/MANIFEST.in +0 -0
  10. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/setup.cfg +0 -0
  11. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/__init__.py +0 -0
  12. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/_config.py +0 -0
  13. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/constants.py +0 -0
  14. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/core.py +0 -0
  15. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/http_client.py +0 -0
  16. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto/serializer.py +0 -0
  17. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto_client.egg-info/dependency_links.txt +0 -0
  18. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto_client.egg-info/requires.txt +0 -0
  19. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/src/aiauto_client.egg-info/top_level.txt +0 -0
  20. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/tests/test_pruners.py +0 -0
  21. {aiauto_client-0.1.17 → aiauto_client-0.1.19}/tests/test_samplers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://dashboard.common.aiauto.pangyo.ainode.ai
@@ -101,8 +101,8 @@ time.sleep(5)
101
101
  ```python
102
102
  study_wrapper.get_status()
103
103
  # {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
104
- while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
105
- sleep(10) # 10 마다 한 번 씩
104
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
105
+ time.sleep(10) # 10초마다 확인
106
106
  ```
107
107
  - best trial 을 가져오는 법
108
108
  ```python
@@ -74,8 +74,8 @@ time.sleep(5)
74
74
  ```python
75
75
  study_wrapper.get_status()
76
76
  # {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
77
- while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
78
- sleep(10) # 10 마다 한 번 씩
77
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
78
+ time.sleep(10) # 10초마다 확인
79
79
  ```
80
80
  - best trial 을 가져오는 법
81
81
  ```python
@@ -8,10 +8,11 @@
8
8
  - Mac ARM 환경에서도 문제없이 실행 가능
9
9
 
10
10
  실행:
11
- $ python simple_example.py
11
+ $ python example_simple.py
12
12
  """
13
13
 
14
14
  import aiauto
15
+ import optuna
15
16
  import time
16
17
 
17
18
 
@@ -27,7 +28,6 @@ ac = aiauto.AIAutoController('<token>')
27
28
 
28
29
  # single objective accuracy
29
30
  def objective_simple(trial):
30
- import optuna
31
31
  import aiauto
32
32
  """
33
33
  간단한 2차 함수 최적화
@@ -67,7 +67,7 @@ if __name__ == '__main__':
67
67
  time.sleep(5)
68
68
 
69
69
  study_wrapper.optimize(
70
- simple_objective,
70
+ objective_simple,
71
71
  n_trials=20,
72
72
  parallelism=2, # 동시 실행 Pod 수
73
73
  # use_gpu=False, # default
@@ -75,6 +75,10 @@ if __name__ == '__main__':
75
75
  )
76
76
  time.sleep(5)
77
77
 
78
+ # 최적화가 끝날 때까지 대기
79
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
80
+ time.sleep(10) # 10초마다 확인
81
+
78
82
  study = study_wrapper.get_study()
79
83
 
80
84
  print('\nBest trials:')
@@ -52,6 +52,11 @@ def objective_multi(trial):
52
52
  import aiauto
53
53
 
54
54
 
55
+ # TODO singleton 객체에 토큰 값 지정하면 객체 초기화 시 설정 됨
56
+ # ac.get_artifact_store() 하기 위한 용도로 objective 안에서 한 번 더 초기화
57
+ # singleton 이라서 상관 없다
58
+ ac = aiauto.AIAutoController('<token>')
59
+
55
60
  # objective 함수의 매개변수로 받아온 optuna 자체의 trial 을 aiauto 에서 사용하는 TrialController 로 Warpping Log 찍는 용도
56
61
  # log 는 optuna dashboard 에서 확인 가능
57
62
  # 하나의 trial objective 함수 안에서만 사용하는 trial 객체
@@ -131,7 +136,7 @@ def objective_multi(trial):
131
136
 
132
137
  # 데이터 샘플링 옵션 - 튜닝 시에만 사용
133
138
  data_fraction_number = trial.suggest_categorical('data_fraction_number', [4, 8])
134
- data_subset_idx = trial.suggest_int('data_subset_idx', 0, data_fraction - 1)
139
+ data_subset_idx = trial.suggest_int('data_subset_idx', 0, data_fraction_number - 1)
135
140
 
136
141
  tc.log(f'data_fraction_number={data_fraction_number}, data_subset_idx={data_subset_idx}')
137
142
 
@@ -263,6 +268,11 @@ def objective_detailed(trial):
263
268
  import aiauto
264
269
 
265
270
 
271
+ # TODO singleton 객체에 토큰 값 지정하면 객체 초기화 시 설정 됨
272
+ # ac.get_artifact_store() 하기 위한 용도로 objective 안에서 한 번 더 초기화
273
+ # singleton 이라서 상관 없다
274
+ ac = aiauto.AIAutoController('<token>')
275
+
266
276
  # objective 함수의 매개변수로 받아온 optuna 자체의 trial 을 aiauto 에서 사용하는 TrialController 로 Warpping Log 찍는 용도
267
277
  # log 는 optuna dashboard 에서 확인 가능
268
278
  # 하나의 trial objective 함수 안에서만 사용하는 trial 객체
@@ -438,7 +448,7 @@ if __name__ == '__main__':
438
448
 
439
449
  # ========================= subset data optimize ===========================
440
450
  study_wrapper.optimize(
441
- objective_multi(),
451
+ objective_multi,
442
452
  n_trials=100,
443
453
  parallelism=4, # n_jobs 대신 parallelism 사용
444
454
  use_gpu=True, # GPU 사용
@@ -457,6 +467,10 @@ if __name__ == '__main__':
457
467
  )
458
468
  time.sleep(5)
459
469
 
470
+ # 최적화가 끝날 때까지 대기
471
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
472
+ time.sleep(10) # 10초마다 확인
473
+
460
474
  study = study_wrapper.get_study()
461
475
 
462
476
  for trial in study.best_trials[:5]: # 상위 5개만
@@ -467,8 +481,10 @@ if __name__ == '__main__':
467
481
  print()
468
482
 
469
483
  # ========================== full data optimize ============================
470
- # best_trial 파라미터를 사용해서 전체 데이터로 학습
471
- study.enqueue_trial(study.best_trial)
484
+ # best_trials 중에서 사용자가 원하는 trial 선택해서 전체 데이터로 학습
485
+ # directions가 두 개이므로 accuracy가 가장 높은 trial 또는 FLOPS가 가장 낮은 trial에서 선택
486
+ selected_trial = study.best_trials[0] # 첫 번째 Pareto optimal trial 선택
487
+ study.enqueue_trial(selected_trial)
472
488
  study.optimize(
473
489
  objective_detailed,
474
490
  n_trials=1, # enqueue 한 만큼만 실행
@@ -481,3 +497,7 @@ if __name__ == '__main__':
481
497
  "memory": "4Gi",
482
498
  },
483
499
  )
500
+
501
+ # 전체 데이터 학습이 끝날 때까지 대기
502
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
503
+ time.sleep(10) # 10초마다 확인
@@ -52,6 +52,11 @@ def objective_single(trial):
52
52
  import aiauto
53
53
 
54
54
 
55
+ # TODO singleton 객체에 토큰 값 지정하면 객체 초기화 시 설정 됨
56
+ # ac.get_artifact_store() 하기 위한 용도로 objective 안에서 한 번 더 초기화
57
+ # singleton 이라서 상관 없다
58
+ ac = aiauto.AIAutoController('<token>')
59
+
55
60
  # objective 함수의 매개변수로 받아온 optuna 자체의 trial 을 aiauto 에서 사용하는 TrialController 로 Warpping Log 찍는 용도
56
61
  # log 는 optuna dashboard 에서 확인 가능
57
62
  # 하나의 trial objective 함수 안에서만 사용하는 trial 객체
@@ -266,6 +271,11 @@ def objective_detailed(trial):
266
271
  import aiauto
267
272
 
268
273
 
274
+ # TODO singleton 객체에 토큰 값 지정하면 객체 초기화 시 설정 됨
275
+ # ac.get_artifact_store() 하기 위한 용도로 objective 안에서 한 번 더 초기화
276
+ # singleton 이라서 상관 없다
277
+ ac = aiauto.AIAutoController('<token>')
278
+
269
279
  # objective 함수의 매개변수로 받아온 optuna 자체의 trial 을 aiauto 에서 사용하는 TrialController 로 Warpping Log 찍는 용도
270
280
  # log 는 optuna dashboard 에서 확인 가능
271
281
  # 하나의 trial objective 함수 안에서만 사용하는 trial 객체
@@ -461,6 +471,10 @@ if __name__ == '__main__':
461
471
  )
462
472
  time.sleep(5)
463
473
 
474
+ # 최적화가 끝날 때까지 대기
475
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
476
+ time.sleep(10) # 10초마다 확인
477
+
464
478
  study = study_wrapper.get_study()
465
479
 
466
480
  print('\nBest trials:')
@@ -485,3 +499,7 @@ if __name__ == '__main__':
485
499
  "memory": "4Gi",
486
500
  },
487
501
  )
502
+
503
+ # 전체 데이터 학습이 끝날 때까지 대기
504
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
505
+ time.sleep(10) # 10초마다 확인
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aiauto-client"
7
- version = "0.1.17"
7
+ version = "0.1.19"
8
8
  description = "AI Auto HPO (Hyperparameter Optimization) Client Library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://dashboard.common.aiauto.pangyo.ainode.ai
@@ -101,8 +101,8 @@ time.sleep(5)
101
101
  ```python
102
102
  study_wrapper.get_status()
103
103
  # {'study_name': 'test', 'count_active': 0, 'count_succeeded': 10, 'count_pruned': 0, 'count_failed': 0, 'count_total': 10, 'count_completed': 10, 'dashboard_url': 'https://optuna-dashboard-10f804bb-52be-48e8-aa06-9f5411ed4b0d.aiauto.pangyo.ainode.ai', 'last_error': '', 'updated_at': '2025-09-01T11:31:49.375Z'}
104
- while study_wrapper.get_status()['count_completed'] <= study_wrapper.get_status()['count_total']:
105
- sleep(10) # 10 마다 한 번 씩
104
+ while study_wrapper.get_status()['count_completed'] < study_wrapper.get_status()['count_total']:
105
+ time.sleep(10) # 10초마다 확인
106
106
  ```
107
107
  - best trial 을 가져오는 법
108
108
  ```python
@@ -1,9 +1,9 @@
1
1
  MANIFEST.in
2
2
  README.md
3
3
  pyproject.toml
4
+ examples/example_simple.py
4
5
  examples/example_torch_multiple_objective.py
5
6
  examples/example_torch_single_objective.py
6
- examples/simple_example.py
7
7
  src/aiauto/__init__.py
8
8
  src/aiauto/_config.py
9
9
  src/aiauto/constants.py
File without changes