ebf2c8bb8e5f14d371d5052fafd3a0361fffae0b,doc/source/notebooks/advanced/varying_noise.pct.py,,,#,204

Before Change


set_trainable(model.likelihood, False)

opt = gpflow.optimizers.Scipy()
opt.minimize(objective_closure,
             model.trainable_variables,
             options=dict(maxiter=ci_niter(1000)))

// %% [markdown]
// We"ve now fitted the VGP model to the data, but without optimizing over the hyperparameters. Plotting the data, we see that the fit is not terrible, but hasn"t made use of our knowledge of the varying noise. 

After Change


def objective_closure():
    return - model.log_marginal_likelihood()

for _ in range(ci_niter(1000)):
    natgrad.minimize(objective_closure, [(model.q_mu, model.q_sqrt)])

// %% [markdown]
// We"ve now fitted the VGP model to the data, but without optimizing over the hyperparameters. Plotting the data, we see that the fit is not terrible, but hasn"t made use of our knowledge of the varying noise. 

// %%
// let"s do some plotting!
xx = np.linspace(-5, 5, 200)[:, None]

mu, var = model.predict_f(xx)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: GPflow/GPflow
Commit Name: ebf2c8bb8e5f14d371d5052fafd3a0361fffae0b
Time: 2020-03-03
Author: joel.berkeley@prowler.io
File Name: doc/source/notebooks/advanced/varying_noise.pct.py
Class Name:
Method Name:


Project Name: GPflow/GPflow
Commit Name: ebf2c8bb8e5f14d371d5052fafd3a0361fffae0b
Time: 2020-03-03
Author: joel.berkeley@prowler.io
File Name: doc/source/notebooks/advanced/varying_noise.pct.py
Class Name:
Method Name:


Project Name: GPflow/GPflow
Commit Name: ebf2c8bb8e5f14d371d5052fafd3a0361fffae0b
Time: 2020-03-03
Author: joel.berkeley@prowler.io
File Name: doc/source/notebooks/advanced/varying_noise.pct.py
Class Name:
Method Name: