Skip to content

Commit a0aa36c

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: 475600968
1 parent 75a8603 commit a0aa36c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,19 @@
4646
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
4747
"parameters": [
4848
{
49+
"integer_value_spec": {"max_value": 4, "min_value": 1},
4950
"parameter": "units",
5051
"type": "INTEGER",
51-
"integer_value_spec": {"min_value": 1, "max_value": 4},
52-
"scale_type": "UNIT_LINEAR_SCALE",
5352
}
5453
],
5554
}
5655
STUDY_CONFIG_INT_STEP = {
5756
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
5857
"parameters": [
5958
{
59+
"discrete_value_spec": {"values": [32, 64, 96, 128]},
6060
"parameter": "units",
6161
"type": "DISCRETE",
62-
"discrete_value_spec": {"values": [32, 64, 96, 128]},
6362
}
6463
],
6564
}
@@ -70,7 +69,6 @@
7069
"double_value_spec": {"max_value": 0.5, "min_value": 0.1},
7170
"parameter": "learning_rate",
7271
"type": "DOUBLE",
73-
"scale_type": "UNIT_LINEAR_SCALE",
7472
}
7573
],
7674
}
@@ -121,16 +119,14 @@
121119
"metrics": [{"goal": "MAXIMIZE", "metric": "accuracy"}],
122120
"parameters": [
123121
{
122+
"double_value_spec": {"max_value": 1.57, "min_value": 0.0},
124123
"parameter": "theta",
125124
"type": "DOUBLE",
126-
"double_value_spec": {"min_value": 0.0, "max_value": 1.57},
127-
"scale_type": "UNIT_LINEAR_SCALE",
128125
},
129126
{
127+
"double_value_spec": {"max_value": 1.0, "min_value": 0.0},
130128
"parameter": "r",
131129
"type": "DOUBLE",
132-
"double_value_spec": {"min_value": 0.0, "max_value": 1.0},
133-
"scale_type": "UNIT_LINEAR_SCALE",
134130
},
135131
],
136132
}
@@ -249,8 +245,8 @@ def test_convert_study_config_int(self, min_value, max_value, step,
249245
self._assert_hps_equal(actual_hps, hps)
250246

251247
@parameterized.parameters(
252-
(0.1, 0.5, None, "linear", STUDY_CONFIG_FLOAT),
253-
(1, 2, 0.25, "linear", STUDY_CONFIG_FLOAT_STEP),
248+
(0.1, 0.5, None, None, STUDY_CONFIG_FLOAT),
249+
(1, 2, 0.25, None, STUDY_CONFIG_FLOAT_STEP),
254250
(0.1, 0.8, None, "linear", STUDY_CONFIG_FLOAT_LINEAR_SCALE),
255251
(1e-4, 1e-1, None, "log", STUDY_CONFIG_FLOAT_LOG_SCALE),
256252
(1e-4, 1e-1, None, "reverse_log", STUDY_CONFIG_FLOAT_REVERSE_LOG_SCALE))

0 commit comments

Comments
 (0)