Commit 4a75b58f authored by salbiach's avatar salbiach
Browse files

Corrections in examples. They can run but further testing is required.

parent 232cf2cd
......@@ -52,10 +52,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load("trX.bin")
y_train = eddlT.load("trY.bin")
x_test = eddlT.load("tsX.bin")
y_test = eddlT.load("tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "mnist_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "mnist_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "mnist_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "mnist_tsY.bin")
eddlT.div_(x_train, 255.0)
eddlT.div_(x_test, 255.0)
......
......@@ -84,14 +84,14 @@ def main(args):
p = net_parametersToNumpy(eddl.get_parameters(net))
# print("Los final weights en main son estos: ", p)
print("Freq: ", getFreqFromParameters(p))
sys.stdout.flush()
#print("Freq: ", getFreqFromParameters(p))
#sys.stdout.flush()
print("Param saving")
individualParamsSave(p, "./res_cifar100_lenet_async_cada_20_noise/lenet_params_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".txt")
#print("Param saving")
#individualParamsSave(p, "./res_cifar100_lenet_async_cada_20_noise/lenet_params_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".txt")
print("Net saving")
eddl.save_net_to_onnx_file(net, "./res_cifar100_lenet_async_cada_20_noise/lenet_net_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".onnx")
#print("Net saving")
#eddl.save_net_to_onnx_file(net, "./res_cifar100_lenet_async_cada_20_noise/lenet_net_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".onnx")
# SUPPORT FOR DISTRIBUTRED EVALUATION IS REQUIRED HERE
# print("Evaluating model against train set")
......
......@@ -98,14 +98,14 @@ def main(args):
epoch_end_time = timer()
print("Elapsed time for epoch ", str(i), ": ", str(epoch_end_time - epoch_start_time), " seconds")
print("Freq: ", getFreqFromParameters(p))
sys.stdout.flush()
#print("Freq: ", getFreqFromParameters(p))
#sys.stdout.flush()
print("Param saving")
individualParamsSave(p, "./res_cifar100_lenet_sync/lenet_params_sync_from_0-epoch" + str(i) + ".txt")
#print("Param saving")
#individualParamsSave(p, "./res_cifar100_lenet_sync/lenet_params_sync_from_0-epoch" + str(i) + ".txt")
print("Net saving")
eddl.save_net_to_onnx_file(net, "./res_cifar100_lenet_sync/lenet_net_sync_from_0-epoch" + str(i) + ".onnx")
#print("Net saving")
#eddl.save_net_to_onnx_file(net, "./res_cifar100_lenet_sync/lenet_net_sync_from_0-epoch" + str(i) + ".onnx")
# SUPPORT FOR DISTRIBUTRED EVALUATION IS REQUIRED HERE
# print("Evaluating model against train set")
......@@ -120,6 +120,7 @@ def main(args):
print("Elapsed time: ", final_time, " seconds")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--num_workers", type=int, metavar="INT", default=4)
......
......@@ -49,10 +49,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsY.bin")
eddlT.div_(x_train, 255.0)
eddlT.div_(x_test, 255.0)
......@@ -94,10 +94,10 @@ def main(args):
print("Freq: ", getFreqFromParameters(p))
sys.stdout.flush()
print("Param saving")
#individualParamsSave(p, "./res_lenet_async_cada_20_noise/lenet_params_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".txt")
#print("Param saving")
#individualParamsSave(p, "cifar10_lenet_async_ + str(max_num_async_epochs - 1) + ".txt")
print("Net saving")
#print("Net saving")
#eddl.save_net_to_onnx_file(net, "./res_lenet_async_cada_20_noise/lenet_net_async_from_60-epoch" + str(max_num_async_epochs - 1) + ".onnx")
#print("Evaluating model against train set")
......
......@@ -52,10 +52,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsY.bin")
eddlT.div_(x_train, 255.0)
eddlT.div_(x_test, 255.0)
......@@ -103,17 +103,17 @@ def main(args):
print("Freq: ", getFreqFromParameters(p))
sys.stdout.flush()
print("Param saving")
individualParamsSave(p, "./res_cifar10_lenet_sync/lenet_params_sync_from_0-epoch" + str(i) + ".txt")
#print("Param saving")
#individualParamsSave(p, "cifar10_lenet_sync" + str(i) + ".txt")
print("Net saving")
eddl.save_net_to_onnx_file(net, "./res_cifar10_lenet_sync/lenet_net_sync_from_0-epoch" + str(i) + ".onnx")
#print("Net saving")
#eddl.save_net_to_onnx_file(net, "./res_cifar10_lenet_sync/lenet_net_sync_from_0-epoch" + str(i) + ".onnx")
print("Evaluating model against train set")
eddl.evaluate(net, [x_train], [y_train])
#print("Evaluating model against train set")
#eddl.evaluate(net, [x_train], [y_train])
print("Evaluating model against test set")
compss_api.eddl.evaluate(net, [x_test], [y_test])
#print("Evaluating model against test set")
#compss_api.eddl.evaluate(net, [x_test], [y_test])
end_time = timer()
final_time = end_time - start_time
......
......@@ -48,10 +48,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsY.bin")
eddlT.div_(x_train, 255.0)
eddlT.div_(x_test, 255.0)
......
......@@ -45,10 +45,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load("cifar_trX.bin")
y_train = eddlT.load("cifar_trY.bin")
x_test = eddlT.load("cifar_tsX.bin")
y_test = eddlT.load("cifar_tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsY.bin")
eddlT.div_(x_train, 255.0)
eddlT.div_(x_test, 255.0)
......
......@@ -47,10 +47,10 @@ def main(args):
eddl.summary(net)
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar_tsY.bin")
x_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trX.bin")
y_train = eddlT.load(CVAR_DATASET_PATH + "cifar10_trY.bin")
x_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsX.bin")
y_test = eddlT.load(CVAR_DATASET_PATH + "cifar10_tsY.bin")
# Distribute data
train_images_per_worker = int(eddlT.getShape(x_train)[0] / num_workers)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment