import tensorflow as tf

def random_net_distill(x_ph, a_ph,  hidden_sizes=(400,300), activation=tf.nn.relu,
                       output_activation=tf.tanh, action_space=None, dropout_rate=0.1):
    act_dim = a_ph.shape.as_list()[-1]
    act_limit = action_space.high[0]
    with tf.variable_scope('rnd_targ_act'):
        rnd_targ_act = act_limit * mlp(x_ph, list(hidden_sizes) + [act_dim], activation, output_activation)
    with tf.variable_scope('rnd_pred_act'):
        # rnd_pred_act = act_limit * mlp(x_ph, list(hidden_sizes) + [act_dim], activation, output_activation)
        rnd_pred_act_in_dim = x_ph.shape.as_list()[1]
        rnd_pred_act_dropout_mask_generator = DropoutMaskGenerator(rnd_pred_act_in_dim,
                                                                   hidden_sizes, model_prob=1.0 - dropout_rate)
        rnd_pred_act_dropout_mask_phs = rnd_pred_act_dropout_mask_generator.generate_dropout_mask_placeholders()
