Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpytorch integration - variational GP #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dnguyen1196
Copy link
Collaborator

Example usage can be found in scripts/gp/gp_playground_gpytorch.ipynb

    net_variational_gp = pinot.Net(
        pinot.representation.Sequential(
            pinot.representation.dgl_legacy.gn(kwargs={"allow_zero_in_degree":True}),
                [64, 'relu', 64, 'relu', 64, 'relu']),
        output_regressor_class=pinot.regressors.VariationalGP,
        num_inducing_points=150,
        num_data=902,
        beta = beta,
    )
    
    lr = 1e-4
    optimizer = torch.optim.Adam([
        {'params': net_variational_gp.representation.parameters(), 'weight_decay': 1e-4},
        {'params': net_variational_gp.output_regressor.parameters(), 'lr': lr*0.1}
    ], lr=lr)

    for n in range(n_epochs):
        total_loss = 0.
        for (g, y) in data:
            optimizer.zero_grad()
            loss = net_variational_gp.loss(g, y.flatten())
            loss.backward()
            optimizer.step()
            total_loss += loss.item()

@dnguyen1196 dnguyen1196 requested a review from miretchin February 4, 2021 04:55
@karalets
Copy link
Collaborator

karalets commented Apr 1, 2021

guys, can we get some movement here?

@miretchin
Copy link
Collaborator

miretchin commented Apr 2, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants