(self, model_load_path, artist_name, test, prime_text)
Initializes the Lyric Generation Runner.

        @param model_load_path: The path from which to load a previously-saved model.
                                Default = None.
        @param artist_name: The name of the artist on which to train. (Used to grab data).
                            Default = 'kanye_west'
        @param test: Whether to test or train the model. Testing generates a sequence from the
                     provided model and artist. Default = False.
        @param prime_text: The text with which to start the test sequence.
Initializes the Lyric Generation Runner.
Initializes the Lyric Generation Runner .
def __init__(self, model_load_path, artist_name, test, prime_text):
        """
        Initializes the Lyric Generation Runner.

        @param model_load_path: The path from which to load a previously-saved model.
                                Default = None.
        @param artist_name: The name of the artist on which to train. (Used to grab data).
                            Default = 'kanye_west'
        @param test: Whether to test or train the model. Testing generates a sequence from the
                     provided model and artist. Default = False.
        @param prime_text: The text with which to start the test sequence.
        """

        self.sess = tf.Session()
        self.artist_name = artist_name

        print 'Process data...'
        self.data_reader = DataReader(self.artist_name)
        self.vocab = self.data_reader.get_vocab()

        print 'Init model...'
        self.model = LSTMModel(self.sess,
                               self.vocab,
                               c.BATCH_SIZE,
                               c.SEQ_LEN,
                               c.CELL_SIZE,
                               c.NUM_LAYERS,
                               test=test)

        print 'Init variables...'
        self.saver = tf.train.Saver(max_to_keep=None)
        self.sess.run(tf.global_variables_initializer())

        # if load path specified, load a saved model
        if model_load_path is not None:
            self.saver.restore(self.sess, model_load_path)
            print 'Model restored from ' + model_load_path


        if test:
            self.test(prime_text)
        else:
            self.train()
def __init__ ( self , model_load_path , artist_name , test , prime_text ) : self . sess = tf . Session ( ) self . artist_name = artist_name print 'Process data...' self . data_reader = DataReader ( self . artist_name ) self . vocab = self . data_reader . get_vocab ( ) print 'Init model...' self . model = LSTMModel ( self . sess , self . vocab , c . BATCH_SIZE , c . SEQ_LEN , c . CELL_SIZE , c . NUM_LAYERS , test = test ) print 'Init variables...' self . saver = tf . train . Saver ( max_to_keep = None ) self . sess . run ( tf . global_variables_initializer ( ) ) # if load path specified, load a saved model if model_load_path is not None : self . saver . restore ( self . sess , model_load_path ) print 'Model restored from ' + model_load_path if test : self . test ( prime_text ) else : self . train ( )