Skip to content

Commit 50571c9

Browse files
committed
Merge branch 'master' of https://github.com/ctallec/pyvarinf
2 parents 617d4a2 + 8c8dd3b commit 50571c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ var_model.set_prior('mixtgauss', n_mc_samples, sigma_1, sigma_2, pi)
171171
* `pi` the probability of the first gaussian
172172

173173
# Requirements
174-
You need to have PyTorch installed for PyVarInf to work (as PyTorch is not readily available on PyPi). To install PyTorch, follow the instructions described [here](http://pytorch.org/#pip-install-pytorch).
174+
This module requires Python 3. You need to have PyTorch installed for PyVarInf to work (as PyTorch is not readily available on PyPi). To install PyTorch, follow the instructions described [here](http://pytorch.org/#pip-install-pytorch).
175175

176176
# References
177177
* [1] Blundell, Charles, Cornebise, Julien, Kavukcuoglu, Koray, and Wierstra, Daan. Weight Uncertainty in Neural Networks. In *International Conference on Machine Learning*, pp. 1613–1622, 2015.

pyvarinf/vi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ def _variationalize_module(self, dico, module, prefix, zero_mean,
255255
None)
256256

257257
if learn_mean:
258-
self.register_parameter(prefix + '.' + name + '_mean',
258+
self.register_parameter(prefix + '_' + name + '_mean',
259259
dico[name].mean)
260260
if learn_rho:
261-
self.register_parameter(prefix + '.' + name + '_rho',
261+
self.register_parameter(prefix + '_' + name + '_rho',
262262
dico[name].rho)
263263

264264
to_erase.append(name)
@@ -269,7 +269,7 @@ def _variationalize_module(self, dico, module, prefix, zero_mean,
269269
for mname, sub_module in module.named_children():
270270
sub_dico = OrderedDict()
271271
self._variationalize_module(sub_dico, sub_module,
272-
prefix + ('.' if prefix else '') +
272+
prefix + ('_' if prefix else '') +
273273
mname, zero_mean,
274274
learn_mean, learn_rho)
275275
dico[mname] = sub_dico

0 commit comments

Comments
 (0)