GMM example locations

When running the example at https://pyro.ai/examples/gmm.html
I find that the locations do not change during training.
Is this intended? Or have I go the wrong variable to monitor?

I changed In[6] to:

# Register hooks to monitor gradient norms.
gradient_norms = defaultdict(list)
for name, value in pyro.get_param_store().named_parameters():
    value.register_hook(lambda g, name=name: gradient_norms[name].append(g.norm().item()))

losses, locs, adlocs = [], [], []
for i in range(200 if not smoke_test else 2):
    loss = svi.step(data)
    locs.append(global_guide()['locs'])
    adlocs.append(pyro.get_param_store().get_param('AutoDelta.locs'))
    losses.append(loss)
    print('.' if i % 100 else '\n', end='')   

Note that every item of locs and adlocs contains the value [0.4990, 10.9845]

Don’t forget to .clone() when you save snapshots. I believe you’re saving shallow copies that end up all pointing to the same data :wink:

Thanks!