7bd676c9ab6b23ec93499fd72aeadee3a334a163,skopt/utils.py,,normalize_dimensions,#Any#,443
Before Change
dimensions.
dim_types = [check_dimension(d) for d in dimensions]
is_cat = all([isinstance(d, Categorical) for d in dim_types])
if is_cat:
transformed_dims = [check_dimension(d, transform="identity")
for d in dimensions]
else:
transformed_dims = []
for dim_type, dim in zip(dim_types, dimensions):
if isinstance(dim_type, Categorical):
transformed_dims.append(
check_dimension(dim, transform="onehot")
)
// To make sure that GP operates in the [0, 1] space
else:
transformed_dims.append(
check_dimension(dim, transform="normalize")
)
return transformed_dims
After Change
Real(dimension.low, dimension.high, dimension.prior,
transform="normalize")
)
elif isinstance(dimension, Integer):
transformed_dimensions.append(
Integer(dimension.low, dimension.high,
transform="normalize")
)
else:
raise RuntimeError("Unknown dimension type "
"(%s)" % type(dimension))
return Space(transformed_dimensions)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: scikit-optimize/scikit-optimize
Commit Name: 7bd676c9ab6b23ec93499fd72aeadee3a334a163
Time: 2017-08-18
Author: betatim@gmail.com
File Name: skopt/utils.py
Class Name:
Method Name: normalize_dimensions
Project Name: stellargraph/stellargraph
Commit Name: 1dbc4bf21b2f67189f3a0c761a774ccaadb47587
Time: 2018-07-26
Author: docherty@gmail.com
File Name: stellar/mapper/node_mappers.py
Class Name: GraphSAGENodeMapper
Method Name: __init__
Project Name: pytorch/fairseq
Commit Name: 29b8a4deb58ca9798b61690a31de1ea57de92122
Time: 2020-05-29
Author: yqw@fb.com
File Name: fairseq/trainer.py
Class Name: Trainer
Method Name: _check_grad_norms