#NEWLINE# @ wraps ( Conditional . sample_from_conditional ) #NEWLINE# def sample_from_conditional( self , conditional_params , epsilon = None , num_samples = None ) : #NEWLINE# #INDENT# if ( epsilon is not None ) : #NEWLINE# #INDENT# raise ValueError ( ( ( str ( self . __class__ ) + ' is not able to sample ' ) + 'using the reparametrization trick.' ) ) #NEWLINE# #UNINDENT# if ( num_samples is None ) : #NEWLINE# #INDENT# raise ValueError ( 'number of requested samples needs to be given.' ) #NEWLINE# #UNINDENT# conditional_probs = T . nnet . sigmoid ( conditional_params [ 0 ] ) #NEWLINE# return ( self . theano_rng . uniform ( size = ( num_samples , epsilon . ndim ) , dtype = theano . config . floatX ) < conditional_probs )