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


        // 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: 3

Non-data size: 3

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: ray-project/ray
Commit Name: 905652cdd63ae7116fe58f74856e9caf5340345a
Time: 2020-12-12
Author: krfricke@users.noreply.github.com
File Name: python/ray/tune/integration/xgboost.py
Class Name: TuneReportCallback
Method Name: _get_report_dict


Project Name: tensorlayer/tensorlayer
Commit Name: bd871f214ce22f5669e3c27885ae16372b90f5f5
Time: 2018-02-22
Author: luo.mai.cs@gmail.com
File Name: tensorlayer/layers/time_distribution.py
Class Name: TimeDistributedLayer
Method Name: __init__