afb4e78c5c9c4782482777fd8587c636711ab2e5,src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py,GridSearchTuner,_parse_quniform,#GridSearchTuner#Any#,98

Before Change


        """parse type of quniform parameter and return a list"""
        low, high, interval = param_value[0], param_value[1], param_value[2]
        count = int(np.floor((high - low) / interval)) + 1
        return [low + interval * i for i in range(count)]

    def _parse_randint(self, param_value):
        """parse type of randint parameter and return a list"""
        return np.arange(param_value[0], param_value[1]).tolist()

After Change


    def _parse_quniform(self, param_value):
        """parse type of quniform parameter and return a list"""
        low, high, q = param_value[0], param_value[1], param_value[2]
        return np.clip(np.arange(np.round(low/q), np.round(high/q)+1) * q, low, high)

    def _parse_randint(self, param_value):
        """parse type of randint parameter and return a list"""
        return np.arange(param_value[0], param_value[1]).tolist()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: microsoft/nni
Commit Name: afb4e78c5c9c4782482777fd8587c636711ab2e5
Time: 2019-08-04
Author: suiguoxin@gmail.com
File Name: src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
Class Name: GridSearchTuner
Method Name: _parse_quniform


Project Name: OpenNMT/OpenNMT-py
Commit Name: ba164c0dbb3d8171004380956a88431f4e8248ba
Time: 2017-08-01
Author: bpeters@coli.uni-saarland.de
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: make_positional_encodings


Project Name: keras-team/keras
Commit Name: 65a215646c653ab808170c8b8c10de2945262613
Time: 2017-04-07
Author: myutwo150@users.noreply.github.com
File Name: keras/backend/theano_backend.py
Class Name:
Method Name: in_top_k