def load_partially_trained_model(): obj = pickle.load(open(PARTIALLY_TRAINED_MODEL, 'rb')) params = language_model.Params(obj['word_embedding_weights'], obj['embed_to_hid_weights'], obj['hid_to_output_weights'], obj['hid_bias'], obj['output_bias']) vocab = obj['vocab'] return language_model.Model(params, vocab)
def load_partially_trained_model(): obj = cPickle.load(open(PARTIALLY_TRAINED_MODEL, 'rb')) params = language_model.Params(obj[WORD_EMBEDDING_WEIGHTS], obj[EMBED_TO_HID_WEIGHTS], obj[HID_TO_OUTPUT_WEIGHTS], obj[HID_BIAS], obj[OUTPUT_BIAS]) vocab = obj[VOCAB] return language_model.Model(params, vocab)