def valid(outfile = 'output/new_lstm_result.pkl'): import unidatica from const import N_EMO n_emo = 2 #N_EMO dataset = unidatica.load(n_emo, 1000) lstm = LstmClassifier() lstm.load() test_x, test_y = dataset[2] preds_prob = lstm.classify(test_x) cPickle.dump((test_y, preds_prob), open(outfile, 'w'))
def main(): from const import N_EMO n_emo = 2 #N_EMO # 2 import unidatica dataset = unidatica.load(n_emo, 1000) #, 1000 lstm = LstmClassifier() res = lstm.train( dataset = dataset, ydim = n_emo, fname_model = FNAME_MODEL, reload_model = True, )
def valid(): import cPickle import tfcoder from const import PKL_TFCODER, N_EMO coder = cPickle.load(open(PKL_TFCODER, 'r')) n_emo = N_EMO import unidatica dataset = unidatica.load(n_emo) lstm = LstmClassifier() lstm.load( ydim = n_emo, n_words = coder.n_code(), ) test_x, test_y = dataset[2] preds_prob = lstm.classify(test_x) cPickle.dump((test_y, preds_prob), open('output/lstm_result.pkl', 'w'))
def main(): import cPickle import tfcoder from const import PKL_TFCODER, N_EMO coder = cPickle.load(open(PKL_TFCODER, 'r')) n_emo = N_EMO # 2 import unidatica dataset = unidatica.load(n_emo) #, 1000 lstm = LstmClassifier() res = lstm.train( dataset = dataset, ydim = n_emo, n_words = coder.n_code(), fname_model = FNAME_MODEL, reload_model = False, )