Skip to content

Commit

Permalink
Move optimization metrics to a Bayesian task
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Nov 1, 2023
1 parent 7e1c6aa commit 17983ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions examples/task-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
style: single
rules:
value: 25

optimization-target-metric: goodness
optimization-target-value: 7.2
- task:
step: run training
name: task 2 linear
Expand Down Expand Up @@ -51,8 +52,6 @@
execution-count: 420
maximum-queued-executions: 17
on-child-error: stop_all-AND_error # will be normalized
optimization-target-metric: goodness
optimization-target-value: 7.2
parameters:
- name: A
style: logspace
Expand Down
9 changes: 7 additions & 2 deletions tests/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ def test_tasks_parameters(task_config: Config):
assert isinstance(task.parameters[0].style, VariantParameterStyle)


def test_task_additional_fields(task_config: Config):
def test_task_additional_fields_1(task_config: Config):
task = task_config.tasks["task 4 logspace"]
assert task.execution_batch_size == 42
assert task.execution_count == 420
assert task.maximum_queued_executions == 17
assert task.on_child_error == TaskOnChildError.STOP_ALL_AND_ERROR
assert task.type == TaskType.RANDOM_SEARCH


def test_task_additional_fields_2(task_config: Config):
task = task_config.tasks["task 1 single"]
assert task.type == TaskType.BAYESIAN_TPE
assert task.optimization_target_metric == "goodness"
assert task.optimization_target_value == 7.2
assert task.type == TaskType.RANDOM_SEARCH

0 comments on commit 17983ed

Please sign in to comment.