'Returns sampled random variables parameterized by log_alpha.'

def _random_sample(self, log_alpha, u, layer):

    if (layer not in self.uniform_samples_v):
        self.uniform_samples_v[layer] = self._u_to_v(log_alpha, u)
    x = ((log_alpha + U.safe_log_prob(u)) - U.safe_log_prob((1 - u)))
    samples = tf.stop_gradient(tf.to_float((x > 0)))
    return {'preactivation': x, 'activation': samples, 'log_param': log_alpha}
