18
18
ConvergenceBenchmarkSettings ,
19
19
)
20
20
21
- DIMENSION = 4 # input dimensionality of the test function
21
+ DIMENSION = 4 # input dimensionality of the function
22
22
POINTS_PER_DIM = 15 # number of grid points per input dimension
23
23
BOUNDS = Michalewicz (dim = DIMENSION ).bounds
24
24
@@ -42,11 +42,11 @@ def get_data() -> pd.DataFrame:
42
42
Returns:
43
43
Data for benchmark.
44
44
"""
45
- test_functions = {
46
- "Test_Function " : lambda x : Michalewicz (dim = DIMENSION , negate = True )
45
+ functions = {
46
+ "Target_Function " : lambda x : Michalewicz (dim = DIMENSION , negate = True )
47
47
.forward (torch .tensor (x ))
48
48
.item (),
49
- "Training_Function " : lambda x : Michalewicz (
49
+ "Source_Function " : lambda x : Michalewicz (
50
50
dim = DIMENSION , noise_std = 0.15 , negate = True
51
51
)
52
52
.forward (torch .tensor (x ))
@@ -56,7 +56,7 @@ def get_data() -> pd.DataFrame:
56
56
grid = np .meshgrid (* [points for points in _grid_locations ().values ()])
57
57
58
58
lookups = []
59
- for function_name , function in test_functions .items ():
59
+ for function_name , function in functions .items ():
60
60
lookup = pd .DataFrame (
61
61
{f"x{ d } " : grid_d .ravel () for d , grid_d in enumerate (grid )}
62
62
)
@@ -70,8 +70,8 @@ def get_data() -> pd.DataFrame:
70
70
71
71
data = get_data ()
72
72
73
- test_task = "Test_Function "
74
- source_task = "Training_Function "
73
+ target_task = "Target_Function "
74
+ source_task = "Source_Function "
75
75
76
76
77
77
def space_data () -> (
@@ -99,15 +99,15 @@ def space_data() -> (
99
99
100
100
task_param = TaskParameter (
101
101
name = "Function" ,
102
- values = [test_task , source_task ],
103
- active_values = [test_task ],
102
+ values = [target_task , source_task ],
103
+ active_values = [target_task ],
104
104
)
105
105
106
106
objective = SingleTargetObjective (target = NumericalTarget (name = "Target" , mode = "MAX" ))
107
107
searchspace = SearchSpace .from_product (parameters = [* data_params , task_param ])
108
108
searchspace_nontl = SearchSpace .from_product (parameters = data_params )
109
109
110
- lookup = data .query (f'Function=="{ test_task } "' ).copy (deep = True )
110
+ lookup = data .query (f'Function=="{ target_task } "' ).copy (deep = True )
111
111
initial_data = data .query (f'Function=="{ source_task } "' , engine = "python" ).copy (
112
112
deep = True
113
113
)
0 commit comments