Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to open parameters #10

Open
JonOnEarth opened this issue Jan 30, 2022 · 1 comment
Open

Way to open parameters #10

JonOnEarth opened this issue Jan 30, 2022 · 1 comment

Comments

@JonOnEarth
Copy link

Hi,
Recently I am doing some work in BNN for federated learning, found this nice work(TyXe) for BNN. Is there a way that TyXe can open the parameters of BNN and then we can do some aggregation among several BNNs.

For example, if we can get the BNN1 weight as Gaussian G(mean1, variance1), another BNN2 G(mean2, variance2). We can aggregate as two gaussian fusion.

really want to use and cite this code if possible.
Thanks.

@hpplyt
Copy link
Collaborator

hpplyt commented Feb 2, 2022

Yes that should be possible. The easiest way of accessing parameters would be through pyro's parameter store, i.e. just call pyro.get_param_store(). This gives you a global key-value mapping where all parameters live.

Just be aware that if you instantiate multiple BNN objects you will need to use the name argument in the init function for the BNNs to avoid name clashes (we should mention that in the docs, thanks for bringing it up!). Let me know if you encounter any issues, I haven't tested that use case before, but would expect things to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants