choderalab / pinot

Probabilistic Inference for NOvel Therapeutics
MIT License
15 stars 2 forks source link

Gpytorch integration - variational GP #122

Open dnguyen1196 opened 3 years ago

dnguyen1196 commented 3 years ago

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()
karalets commented 3 years ago

guys, can we get some movement here?

miretchin commented 3 years ago

Yeah, Duc and I have been discussing progress on it and benchmarking

On Wed, Mar 31, 2021, 8:13 PM karalets @.***> wrote:

guys, can we get some movement here?

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/choderalab/pinot/pull/122#issuecomment-811546900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADZLMWQQKKS5HBNKJ2G2WTTGO3BNANCNFSM4XCEA4IQ .