#NEWLINE# def predict_generator( self , generator , val_samples , max_q_size = 10 ) : #NEWLINE# #INDENT# 'Generates predictions for the input samples from a data generator.\n        The generator should return the same kind of data as accepted by\n        `predict_on_batch`.\n\n        # Arguments\n            generator: generator yielding batches of input samples.\n            val_samples: total number of samples to generate from `generator`\n                before returning.\n            max_q_size: maximum size for the generator queue\n\n        # Returns\n            A Numpy array of predictions.\n        ' #NEWLINE# if ( self . model is None ) : #NEWLINE# #INDENT# raise Exception ( 'The model needs to be compiled before being used.' ) #NEWLINE# #UNINDENT# return self . model . predict_generator ( val_samples , val_samples , max_q_size = max_q_size )