def transfer(args):
    load_model = (args.load_model if (args.mode == 'train') else True)

    class Dummy():
        pass
    train_env = Dummy()
    infer_env = Dummy()
    (_, infer_graph) = model(args, train_env, infer_env)
    args.data = 'overnight'
    args.load_data = True
    (X_tran, y_tran) = load_data(maxlen=args.maxlen, load=args.load_data, s='overnight')
    args.data = 'overnight_set'
    tran_sets = load_data(maxlen=args.maxlen, load=args.load_data, s='overnight_set')
    model2load = 'model/{}'.format(args.subset)
    sess = tf.InteractiveSession(graph=infer_graph)
    infer_env.infer_saver.restore(sess, model2load)
    print('========subset transfer set========')
    subsets = ['basketball', 'calendar', 'housing', 'recipes', 'restaurants']
    for (subset, (X_tran_subset, y_tran_subset)) in zip(subsets, tran_sets):
        print((('---------' + subset) + '---------'))
        tran_em = decode_data(sess, infer_env, X_tran_subset, y_tran_subset, filename=str((subset + '.txt')))
    print('===========transfer set============')
    tran_em = decode_data(sess, infer_env, X_tran, y_tran)
    return
def transfer(args):
    load_model = (args.load_model if (args.mode == 'train') else True)

    class Dummy():
        pass
    train_env = Dummy()
    infer_env = Dummy()
    (_, infer_graph) = model(args, train_env, infer_env)
    args.data = 'overnight'
    args.load_data = True
    (X_tran, y_tran) = load_data(maxlen=args.maxlen, load=args.load_data, s='overnight')
    args.data = 'overnight_set'
    tran_sets = load_data(maxlen=args.maxlen, load=args.load_data, s='overnight_set')
    model2load = 'model/{}'.format(args.subset)
    sess = tf.InteractiveSession(graph=infer_graph)
    infer_env.infer_saver.restore(sess, model2load)
    print('========subset transfer set========')
    subsets = ['basketball', 'calendar', 'housing', 'recipes', 'restaurants']
    for (subset, (X_tran_subset, y_tran_subset)) in zip(subsets, tran_sets):
        print((('---------' + subset) + '---------'))
        tran_em = decode_data(sess, infer_env, X_tran_subset, y_tran_subset, filename=str((subset + '.txt')))
    print('===========transfer set============')
    tran_em = decode_data(sess, infer_env, X_tran, y_tran)
    return