a0351c62548ebddf5c728ec525ad61a4f7827494,tests/hypermodel/test_preprocessor.py,,test_normalize,#,23
Before Change
def test_normalize():
normalize = preprocessor.Normalization()
x_train = np.random.rand(100, 32, 32, 3)
dataset = tf.data.Dataset.from_tensor_slices(x_train)
normalize.set_hp(kerastuner.HyperParameters())
for x in dataset:
normalize.update(x)
normalize.finalize()
normalize.set_config(normalize.get_config())
weights = normalize.get_weights()
normalize.clear_weights()
normalize.set_weights(weights)
for a in dataset:
normalize.transform(a)
def map_func(x):
return tf.py_function(normalize.transform,
inp=[x],
Tout=(tf.float64,))
new_dataset = dataset.map(map_func)
for _ in new_dataset:
pass
assert isinstance(new_dataset, tf.data.Dataset)
def test_sequence():
After Change
def test_normalize():
dataset = common.generate_data(dtype="dataset")
new_dataset = run_preprocessor(preprocessor.Normalization(),
dataset,
common.generate_data(dtype="dataset"),
dtype=tf.float32)
assert isinstance(new_dataset, tf.data.Dataset)
def test_sequence():
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 19
Instances
Project Name: keras-team/autokeras
Commit Name: a0351c62548ebddf5c728ec525ad61a4f7827494
Time: 2019-09-29
Author: jhfjhfj1@gmail.com
File Name: tests/hypermodel/test_preprocessor.py
Class Name:
Method Name: test_normalize
Project Name: keras-team/autokeras
Commit Name: a0351c62548ebddf5c728ec525ad61a4f7827494
Time: 2019-09-29
Author: jhfjhfj1@gmail.com
File Name: tests/hypermodel/test_preprocessor.py
Class Name:
Method Name: test_feature_engineering
Project Name: jhfjhfj1/autokeras
Commit Name: a0351c62548ebddf5c728ec525ad61a4f7827494
Time: 2019-09-29
Author: jhfjhfj1@gmail.com
File Name: tests/hypermodel/test_preprocessor.py
Class Name:
Method Name: test_normalize