(inputs, size = None, is_training = True)
Implementation of Zoneout from https://arxiv.org/pdf/1606.01305.pdf
Implementation of Zoneout from https://arxiv.org/pdf/1606.01305.pdf
Implementation of Zoneout from https : // arxiv . org / pdf / 1606 . 01305 . pdf
def apply_dropout(inputs, size = None, is_training = True):
    '''
    Implementation of Zoneout from https://arxiv.org/pdf/1606.01305.pdf
    '''
    if Params.dropout is None and Params.zoneout is None:
        return inputs
    if Params.zoneout is not None:
        return ZoneoutWrapper(inputs, state_zoneout_prob= Params.zoneout, is_training = is_training)
    elif is_training:
        return tf.contrib.rnn.DropoutWrapper(inputs,
                                            output_keep_prob = 1 - Params.dropout,
                                            # variational_recurrent = True,
                                            # input_size = size,
                                            dtype = tf.float32)
    else:
        return inputs
def apply_dropout ( inputs , size = None , is_training = True ) : if Params . dropout is None and Params . zoneout is None : return inputs if Params . zoneout is not None : return ZoneoutWrapper ( inputs , state_zoneout_prob = Params . zoneout , is_training = is_training ) elif is_training : return tf . contrib . rnn . DropoutWrapper ( inputs , output_keep_prob = 1 - Params . dropout , # variational_recurrent = True, # input_size = size, dtype = tf . float32 ) else : return inputs