Open njordhov opened 6 years ago
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
The "Privacy Algorithm" implementation in Chapter 2 can perhaps be improved using a theano switch expression:
It is currently implemented as:
A python conditional expression unfortunately doesn't do the trick: