GMM example locations

When running the example at
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)
    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: