Skip to content

Commit 85b6e0b

Browse files
haifeng-jinTensorflow Cloud maintainers
authored andcommitted
Sync KerasTuner from GitHub
Update of keras_tuner from https://github.com/keras-team/keras-tuner. PiperOrigin-RevId: 480459137
1 parent a0aa36c commit 85b6e0b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/python/tensorflow_cloud/tuner/tests/unit/utils_test.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,20 @@
4646
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
4747
"parameters": [
4848
{
49-
"integer_value_spec": {"max_value": 4, "min_value": 1},
5049
"parameter": "units",
5150
"type": "INTEGER",
51+
"integer_value_spec": {"min_value": 1, "max_value": 4},
52+
"scale_type": "UNIT_LINEAR_SCALE",
5253
}
5354
],
5455
}
5556
STUDY_CONFIG_INT_STEP = {
5657
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
5758
"parameters": [
5859
{
59-
"discrete_value_spec": {"values": [32, 64, 96, 128]},
6060
"parameter": "units",
6161
"type": "DISCRETE",
62+
"discrete_value_spec": {"values": [32, 64, 96, 128]},
6263
}
6364
],
6465
}
@@ -69,6 +70,7 @@
6970
"double_value_spec": {"max_value": 0.5, "min_value": 0.1},
7071
"parameter": "learning_rate",
7172
"type": "DOUBLE",
73+
"scale_type": "UNIT_LINEAR_SCALE",
7274
}
7375
],
7476
}
@@ -119,14 +121,16 @@
119121
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
120122
"parameters": [
121123
{
122-
"double_value_spec": {"max_value": 1.57, "min_value": 0.0},
123124
"parameter": "theta",
124125
"type": "DOUBLE",
126+
"double_value_spec": {"min_value": 0.0, "max_value": 1.57},
127+
"scale_type": "UNIT_LINEAR_SCALE",
125128
},
126129
{
127-
"double_value_spec": {"max_value": 1.0, "min_value": 0.0},
128130
"parameter": "r",
129131
"type": "DOUBLE",
132+
"double_value_spec": {"min_value": 0.0, "max_value": 1.0},
133+
"scale_type": "UNIT_LINEAR_SCALE",
130134
},
131135
],
132136
}
@@ -245,8 +249,8 @@ def test_convert_study_config_int(self, min_value, max_value, step,
245249
self._assert_hps_equal(actual_hps, hps)
246250

247251
@parameterized.parameters(
248-
(0.1, 0.5, None, None, STUDY_CONFIG_FLOAT),
249-
(1, 2, 0.25, None, STUDY_CONFIG_FLOAT_STEP),
252+
(0.1, 0.5, None, "linear", STUDY_CONFIG_FLOAT),
253+
(1, 2, 0.25, "linear", STUDY_CONFIG_FLOAT_STEP),
250254
(0.1, 0.8, None, "linear", STUDY_CONFIG_FLOAT_LINEAR_SCALE),
251255
(1e-4, 1e-1, None, "log", STUDY_CONFIG_FLOAT_LOG_SCALE),
252256
(1e-4, 1e-1, None, "reverse_log", STUDY_CONFIG_FLOAT_REVERSE_LOG_SCALE))

0 commit comments

Comments
 (0)