Git Product home page Git Product logo

Comments (3)

gpleiss avatar gpleiss commented on June 12, 2024 1

@jrg365 just talked about this. We're thinking it would be good to have lengthscales live on the base kernel class:

class Kernel(Module):
    def __init__(self, has_lengthscale=True, ard_num_dims=None, log_lengthscale_bounds=(-10000, 10000)):
        self.ard_num_dims = ard_num_dims
        if has_lengthscale:
            lengthscale_num_dims = 1 if ard_num_dims is None else ard_num_dims
            self.register_parameter('log_lengthscale', torch.nn.Parameter(torch.Tensor(1, 1, ard_num_dims)),
                                    bounds=log_lengthscale_bounds)

    @property
    def lengthscale(self):
        if 'log_lengthscale' in self.named_parameters().keys():
            return self.log_lengthscale.exp()
        else:
            return None


# ...


class RBFKernel(Kernel):
    def __init__(self, **kwargs):
        kwargs['has_lengthscale'] = True
        super(RBFKernel, self).__init__(**kwargs)
        # ...

Thoughts?

from gpytorch.

darbour avatar darbour commented on June 12, 2024

I agree with @gpleiss and @jrg365 about the length-scales living in the base Kernel class. Since we're likely to re-use them for a variety of kernels, it's much cleaner to just have everything use the same base representation.

from gpytorch.

Balandat avatar Balandat commented on June 12, 2024

Done in #86

from gpytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.