Skip to content

Privacy Algorithm implementation in Ch2_MorePyMC_PyMC3 #379

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

Open
njordhov opened this issue Mar 7, 2018 · 0 comments
Open

Privacy Algorithm implementation in Ch2_MorePyMC_PyMC3 #379

njordhov opened this issue Mar 7, 2018 · 0 comments

Comments

@njordhov
Copy link

njordhov commented Mar 7, 2018

The "Privacy Algorithm" implementation in Chapter 2 can perhaps be improved using a theano switch expression:

val = pm.math.switch(first_coin_flips, true_answers, second_coin_flips) 

It is currently implemented as:

val = first_coin_flips*true_answers + (1 - first_coin_flips)*second_coin_flips

A python conditional expression unfortunately doesn't do the trick:

val = true_answers if first_coin_flips else second_coin_flips
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

1 participant