e35fa2b44d4b59cbcb1b9da9a17bc1e7f6d527b1,src/sdk/pynni/nni/gp_tuner/target_space.py,TargetSpace,array_to_params,#TargetSpace#Any#,94

Before Change


                "Size of array ({}) is different than the ".format(len(x)) +
                "expected number of parameters ({}).".format(len(self.keys))
            )
        return dict(zip(self.keys, x))

    def _as_array(self, x):
        try:
            //x = np.asarray(x, dtype=float)

After Change


        // maintain int type if the choices are int
        // TODO: better implementation
        params = {}
        for i, _bound in enumerate(self._bounds):
            if _bound["_type"] == "choice" and isinstance(_bound["_value"][0], int):
                params.update({self.keys[i]: int(x[i])})
            else:
                params.update({self.keys[i]:  x[i]})

        return params

    def register(self, params, target):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: Microsoft/nni
Commit Name: e35fa2b44d4b59cbcb1b9da9a17bc1e7f6d527b1
Time: 2019-06-20
Author: suiguoxin@gmail.com
File Name: src/sdk/pynni/nni/gp_tuner/target_space.py
Class Name: TargetSpace
Method Name: array_to_params


Project Name: mindsdb/mindsdb
Commit Name: 80ab5f2eb06c8023c6ba4b62c054ff04369913f8
Time: 2020-11-12
Author: stpmax@yandex.ru
File Name: tests/integration_tests/flows/test_mongo.py
Class Name: MongoTest
Method Name: setUpClass


Project Name: raghakot/keras-vis
Commit Name: 0d682b1227799ae56d1031a6a1adbb385a70a6e2
Time: 2016-12-23
Author: ragha@outlook.com
File Name: examples/visualize_layer.py
Class Name:
Method Name: visualize_multiple_categories


Project Name: raghakot/keras-vis
Commit Name: 7f0ae42983727c049b2e67bff7125e5b12773bfd
Time: 2017-06-28
Author: ragha@outlook.com
File Name: examples/visualize_optimization_gif.py
Class Name:
Method Name: generate_opt_gif