action="store_true",
                    default=False,
                    help='Turn GPU mode on or off, default is off.')

results = parser.parse_args()

data_dir = results.data_directory
save_dir = results.save_directory
learning_rate = results.lr
dropout = results.drpt
hidden_units = results.units
epochs = results.num_epochs
gpu_mode = results.gpu

# Load and preprocess data
trainloader, testloader, validloader, train_data, test_data, valid_data = load_data(
    data_dir)

# Load pretrained model
pre_tr_model = results.pretrained_model
model = getattr(models, pre_tr_model)(pretrained=True)

# Build and attach new classifier
if arch == "vgg11" or arch == "vgg13" or arch == "vgg16" or arch == "vgg19":
    input_units = model.classifier[0].in_features
elif arch == "densenet121" or arch == "densenet161":
    input_units = model.classifier.in_features

build_classifier(model, input_units, hidden_units, dropout)

# Recommended to use NLLLoss when using Softmax
criterion = nn.NLLLoss()
"""
Created on Wed Jan 28 14:10:45 2018

@author: Prashant
@github: github.com/prashant45
"""

import numpy as np
import util_functions

#Load training data set 2
trainig_data = util_functions.load_data('./data_set_2/train.csv')

#Split the data into Input and Output
X_train = trainig_data[0] #Population 
Y_train = trainig_data[1] #Profit of food truck business
m = len(X_train)

#Plot the data
util_functions.scatter_plot_data(X_train[:,1], Y_train)

#Some gradient descent settings
theta = np.zeros((1,2))
iterations = 1500
alpha = 0.0005

#Compute Initial Cost
J = util_functions.computeCost(X_train, Y_train, theta, m)

#Run gradient descent algorithm
algorithm_param = util_functions.gradient_descent(X_train, Y_train, theta, alpha)
"""
Created on Wed Jan 28 14:10:45 2018

@author: Prashant
@github: github.com/prashant45
"""

import numpy as np
import util_functions

#Load data set 1 or 2
trainig_data = util_functions.load_data('./data_set_1/ex1data1.txt')

#Split the data into Train, Test
X_train = trainig_data[0][:90, :]  #Population of a city
Y_train = trainig_data[1][:90, :]  #Profit of food truck business
X_test = trainig_data[0][90:, :]
Y_test = trainig_data[1][90:, :]
m_train = len(X_train)
m_test = len(X_test)

#Plot the data
util_functions.scatter_plot_data(X_train[:, 1], Y_train)

#Some gradient descent settings
theta = np.zeros((1, 2))
iterations = 1500
alpha = 0.001

#Compute Initial Cost
J = util_functions.computeCost(X_train, Y_train, theta, m_train)
from util_functions import load_data

import numpy as np

batch_size = 64#128
num_classes = 2
epochs = 12

# input image dimensions
img_rows, img_cols, channels = 100, 100, 4

train_data_path= "/home/lvianell/Desktop/Lorenzo_report/datasets/grasp_figures"

# the data, split between train and test sets
x_train, y_train, x_eval, y_eval = load_data(train_data_path, 0.8)
#(x_train, y_train), (x_eval, y_eval) = mnist.load_data()

test_data_path= "/home/lvianell/Desktop/Lorenzo_report/datasets/grasp_figures/test_set"
x_test, y_test, _, _ = load_data(test_data_path, 1)


if K.image_data_format() == 'channels_first':
    x_train = x_train.reshape(x_train.shape[0], channels, img_rows, img_cols)
    x_eval = x_eval.reshape(x_eval.shape[0], channels, img_rows, img_cols)
    x_test = x_test.reshape(x_test.shape[0], channels, img_rows, img_cols)
    input_shape = (channels, img_rows, img_cols)
else:
    x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, channels)
    x_eval = x_eval.reshape(x_eval.shape[0], img_rows, img_cols, channels)
    x_test = x_test.reshape(x_test.shape[0], img_rows, img_cols ,channels)