def main(input_directory, num_epochs=5):
    print("Loading data...")
    data = load_datasets(input_directory)

    print("Building model...")
    input_var = theano.tensor.tensor4('inputs')
    target_var = theano.tensor.ivector('targets')
    network = build_network(input_var)
    model = build_model(input_var, target_var, network)

    print("Starting training...")
    train_network(data, model, num_epochs)

    print("\nLearned parameters:")
    params = numpy.array(lasagne.layers.get_all_param_values(network))
    param_file = 'output/{}.npy'.format(str(uuid.uuid4()))
    print("Parameters written to {}".format(param_file))
    params.dump(param_file)
def main(input_directory, num_epochs=5):
    print("Loading data...")
    data = load_datasets(input_directory)

    print("Building model...")
    input_var = theano.tensor.tensor4('inputs')
    target_var = theano.tensor.ivector('targets')
    network = build_network(input_var)
    model = build_model(input_var, target_var, network)

    print("Starting training...")
    train_network(data, model, num_epochs)

    print("\nLearned parameters:")
    params = numpy.array(lasagne.layers.get_all_param_values(network))
    param_file = 'output/{}.npy'.format(str(uuid.uuid4()))
    print("Parameters written to {}".format(param_file))
    params.dump(param_file)