2569000cefffaf43831e807850c583f0f7172524,abcpy/bo/gpy_model.py,GpyModel,_get_kernel,#GpyModel#,35

Before Change



    def _get_kernel(self):
         Internal function to generate kernel for GPy model 
        if self.gp_kernel_type == "exponential":
            return GPy.kern.Exponential(input_dim=self.n_var,
                                        variance=self.gp_kernel_var,
                                        lengthscale=self.gp_kernel_scale)
        elif self.gp_kernel_type == "expquad":
            return GPy.kern.ExpQuad(input_dim=self.n_var,
                                    variance=self.gp_kernel_var,
                                    lengthscale=self.gp_kernel_scale)
        elif self.gp_kernel_type == "matern32":
            return GPy.kern.Matern32(input_dim=self.n_var,
                                     variance=self.gp_kernel_var,
                                     lengthscale=self.gp_kernel_scale)
        elif self.gp_kernel_type == "matern52":
            return GPy.kern.Matern52(input_dim=self.n_var,
                                     variance=self.gp_kernel_var,
                                     lengthscale=self.gp_kernel_scale)
        else:
            raise ValueError("Unknown GP kernel type: %s" % (self.gp_kernel_type))

    def update(self, X, Y):
        
            Add (X, Y) as observations, updates GP model.
            X and Y should be 2d numpy arrays with observations in rows.

After Change


        

        if isinstance(self.kernel_class, str):
            self.kernel_class = getattr(GPy.kern, self.kernel_class)
        return self.kernel_class(input_dim=self.input_dim,
                                 variance=self.kernel_var,
                                 lengthscale=self.kernel_lengthscale)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: elfi-dev/elfi
Commit Name: 2569000cefffaf43831e807850c583f0f7172524
Time: 2016-10-21
Author: antti.kangasraasio@hiit.fi
File Name: abcpy/bo/gpy_model.py
Class Name: GpyModel
Method Name: _get_kernel


Project Name: matplotlib/matplotlib
Commit Name: 2c03e251bcc40623ed4643ed6e340b9a4fda1bf2
Time: 2020-02-08
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/scale.py
Class Name: LogScale
Method Name: __init__


Project Name: pyannote/pyannote-audio
Commit Name: b6cab97a8b9134bdf45becbf2c5c3e57d51e663c
Time: 2020-01-20
Author: hbredin@users.noreply.github.com
File Name: pyannote/audio/applications/pyannote_audio.py
Class Name:
Method Name: main