import theano
import numpy as np

theano.config.floatX = 'float32'
np.random.seed(0)

if __name__ == '__main__':
    import argparse
    import train

    parser = argparse.ArgumentParser(description='Train/Test SRL tagger.')

    parser.add_argument('--mode', default='train', help='train/test')
    parser.add_argument('--train_data', help='path to training data')
    parser.add_argument('--dev_data', help='path to dev data')
    parser.add_argument('--test_data', help='path to test data')
    parser.add_argument('--check', default=False, help='print each steps')

    """ NN architecture """
    parser.add_argument('--unit', default='lstm', help='Unit')
    parser.add_argument('--vocab', type=int, default=100000000, help='vocabulary size')
    parser.add_argument('--emb', type=int, default=50, help='dimension of embeddings')
    parser.add_argument('--window', type=int, default=5, help='window size for convolution')
    parser.add_argument('--hidden', type=int, default=32, help='dimension of hidden layer')
    parser.add_argument('--layer', type=int, default=1, help='number of layers')

    """ training options """
    parser.add_argument('--save', type=bool, default=False, help='parameters to be saved or not')
    parser.add_argument('--init_emb', default=None, help='Initial embedding to be loaded')
    parser.add_argument('--opt', default='adam', help='optimization method')
    parser.add_argument('--lr', type=float, default=0.01, help='learning rate')
    parser.add_argument('--reg', type=float, default=0.001, help='L2 Reg rate')
    parser.add_argument('--batch', type=int, default=32, help='batch size')
    parser.add_argument('--epoch', type=int, default=10, help='number of epochs to train')
    parser.add_argument('--no-shuffle', action='store_true', default=False, help='don\'t shuffle training data')
    parser.add_argument('--n_cands', type=int, default=10, help='number of ant candidates')
    parser.add_argument('--data_size', type=int, default=10000, help='number of docs')

    """ test options """
    parser.add_argument('--model', default=None, help='path to model')
    parser.add_argument('--arg_dict', default=None, help='path to arg dict')
    parser.add_argument('--vocab_dict', default=None, help='path to vocab dict')
    parser.add_argument('--emb_dict', default=None, help='path to emb dict')

    argv = parser.parse_args()

    if argv.mode == 'train':
        train.main(argv)
    else:
        pass
