d3721b76a8ec4f98932474834ca9add20e7f04e8,GPy/kern/parts/linear.py,Linear,__init__,#Linear#Any#Any#Any#,28

Before Change


        self.input_dim = input_dim
        self.ARD = ARD
        if ARD == False:
            self.num_params = 1
            self.name = "linear"
            if variances is not None:
                variances = np.asarray(variances)
                assert variances.size == 1, "Only one variance needed for non-ARD kernel"
            else:
                variances = np.ones(1)
            self._Xcache, self._X2cache = np.empty(shape=(2,))
        else:
            self.num_params = self.input_dim
            self.name = "linear"
            if variances is not None:
                variances = np.asarray(variances)
                assert variances.size == self.input_dim, "bad number of lengthscales"
            else:
                variances = np.ones(self.input_dim)
        self._set_params(variances.flatten())

        // initialize cache
        self._Z, self._mu, self._S = np.empty(shape=(3, 1))
        self._X, self._X2, self._params = np.empty(shape=(3, 1))

After Change


    :rtype: kernel object
    

    def __init__(self, input_dim, variances=None, ARD=False):
        super(Linear, self).__init__(input_dim, "linear")
        self.ARD = ARD
        if ARD == False:
            if variances is not None:
                variances = np.asarray(variances)
                assert variances.size == 1, "Only one variance needed for non-ARD kernel"
            else:
                variances = np.ones(1)
            self._Xcache, self._X2cache = np.empty(shape=(2,))
        else:
            if variances is not None:
                variances = np.asarray(variances)
                assert variances.size == self.input_dim, "bad number of lengthscales"
            else:
                variances = np.ones(self.input_dim)
        
        self.variances = Param("variances", variances)
        self.add_parameters(self.variances)

        // initialize cache
        self._Z, self._mu, self._S = np.empty(shape=(3, 1))
        self._X, self._X2 = np.empty(shape=(2, 1))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: SheffieldML/GPy
Commit Name: d3721b76a8ec4f98932474834ca9add20e7f04e8
Time: 2013-10-25
Author: ibinbei@gmail.com
File Name: GPy/kern/parts/linear.py
Class Name: Linear
Method Name: __init__


Project Name: SheffieldML/GPy
Commit Name: d3721b76a8ec4f98932474834ca9add20e7f04e8
Time: 2013-10-25
Author: ibinbei@gmail.com
File Name: GPy/kern/parts/prod.py
Class Name: Prod
Method Name: __init__


Project Name: SheffieldML/GPy
Commit Name: d3721b76a8ec4f98932474834ca9add20e7f04e8
Time: 2013-10-25
Author: ibinbei@gmail.com
File Name: GPy/kern/parts/linear.py
Class Name: Linear
Method Name: __init__


Project Name: SheffieldML/GPy
Commit Name: 8c02e4af36c56f0cac7edc22d3caa8e96e559655
Time: 2013-11-06
Author: ibinbei@gmail.com
File Name: GPy/kern/parts/rbf_inv.py
Class Name: RBFInv
Method Name: __init__