Skip to content
Snippets Groups Projects
Commit f2f7e747 authored by Luc Giffon's avatar Luc Giffon
Browse files

unrelevant changes related to experiments. build_command_line_array shouldn't...

unrelevant changes related to experiments. build_command_line_array shouldn't bu used anymore + changes in drawgraphes relative to cifar10 experiment
parent 63817ce0
No related branches found
No related tags found
No related merge requests found
import numpy as np
import math
if __name__ == '__main__':
batch_size = np.logspace(3, 9, dtype=int, base=2, num=5)
num_epoch = 50
sigma = 5.0
gamma = 0.003
subsample_size = np.logspace(3, 9, dtype=int, base=2, num=5)
raise DeprecationWarning("This should not be used, lazygrid of skluc should be used instead")
batch_size = np.logspace(3, 9, dtype=int, base=2, num=4)
num_epoch = 100
# sigma = np.logspace(-1, 2, base=10, num=3)
sigma = [1]
# gamma = np.logspace(-4, 0, base=10, num=3)
gamma = [1]
subsample_size = np.logspace(3, 9, dtype=int, base=2, num=4)
networks_types = ["dense", "deepfriedconvnet", "deepstorm"]
datasets = ["mnist",
"cifar"]
datasets = ["cifar"]
output_dense = 2048
nys_layer_dim_out = np.logspace(3, int(math.log(output_dense, 2)), dtype=int, base=2, num=5)
nys_layer_dim_out = np.logspace(3, int(math.log(output_dense, 2)), dtype=int, base=2, num=3)
for d in datasets:
for network in networks_types:
s_network = network + " " + "--" + str(d) + " " + "--time" + " " + "--test" + " " + "-e" + " " + str(num_epoch) + " "
for b_size in batch_size:
s_epoch = s_network + "-s " + str(b_size) + " "
if network == "deepfriedconvnet":
s_sigma = s_epoch + "-S " + str(sigma) + " "
print(s_sigma)
for sig in sigma:
s_sigma = s_epoch + "-S " + "{:.5f}".format(sig)
print(s_sigma)
elif network == "deepstorm":
s_gamma = s_epoch + "-G " + str(gamma) + " "
for nys_size in subsample_size:
s_nys = s_gamma + "-m " + str(nys_size) + " "
for nys_output_size in nys_layer_dim_out:
s_nys_out = s_nys + "-w" + " " + str(nys_output_size)
print(s_nys_out)
for gam in gamma:
s_gamma = s_epoch + "-G " + "{:.5f}".format(gam) + " "
for nys_size in subsample_size:
s_nys = s_gamma + "-m " + str(nys_size) + " "
for nys_output_size in nys_layer_dim_out:
s_nys_out = s_nys + "-w" + " " + str(nys_output_size)
print(s_nys_out)
else:
print(s_epoch)
pass
\ No newline at end of file
pass
......@@ -5,11 +5,13 @@ import pandas as pd
pd.set_option('display.width', 1000)
DIRNAME = "/home/luc/PycharmProjects/deepFriedConvnets/main/results_global5"
DIRNAME = "/home/luc/Resultats/Deepstrom/CIFAR10/v2/100_epochs"
FILENAME = "gathered_results"
batch_size = np.logspace(3, 9, dtype=int, base=2, num=5)
subsample_size = np.logspace(3, 9, dtype=int, base=2, num=5)
batch_size = np.logspace(3, 9, dtype=int, base=2, num=4)
# batch_size = np.logspace(3, 9, dtype=int, base=2, num=5)
subsample_size = np.logspace(3, 9, dtype=int, base=2, num=4)
# subsample_size = np.logspace(3, 9, dtype=int, base=2, num=5)
if __name__ == '__main__':
filepath = os.path.join(DIRNAME, FILENAME)
......@@ -25,9 +27,10 @@ if __name__ == '__main__':
"deepstrom_dim"]
df = pd.read_csv(filepath, names=field_names)
df = df[df["dataset"] == "mnist"]
# df = df[df["dataset"] == "mnist"]
df = df[df["dataset"] == "cifar"]
nrows = 3
nrows = 2
ncols = 2
f, axxarr = plt.subplots(nrows, ncols)
f2, axxarr2 = plt.subplots(nrows, ncols)
......@@ -48,9 +51,9 @@ if __name__ == '__main__':
df_batch_size_deepfriedconvnet = df_batch_size[df_batch_size["method_name"] == "DeepFriedConvnet"]
df_batch_size_deepstrom_runtime_sort = df_batch_size_deepstrom.sort_values(by=["runtime"])
axxarr[i][j].set_title("batch size = {}".format(curr_batch_size))
axxarr[i][j].plot(df_batch_size_deepstrom_runtime_sort["runtime"],
axxarr[i][j].scatter(df_batch_size_deepstrom_runtime_sort["runtime"],
df_batch_size_deepstrom_runtime_sort["accuracy"],
label="Deepstrom")
label="Deepstrom", marker="x")
axxarr[i][j].scatter(df_batch_size_dense["runtime"],
df_batch_size_dense["accuracy"], color="r",
label="Dense",
......@@ -59,7 +62,7 @@ if __name__ == '__main__':
df_batch_size_deepfriedconvnet["accuracy"], color="g",
label="DeepFriedConvnet",
marker="x")
axxarr[i][j].legend(loc="lower right")
# axxarr[i][j].legend(loc="lower right")
curr_batch_size_idx += 1
......@@ -68,9 +71,9 @@ if __name__ == '__main__':
# print(df_batch_size_deepstrom)
# print(df_batch_size_deepstrom_subsample_sort)
axxarr2[i][j].set_title("batch size = {}".format(curr_batch_size))
axxarr2[i][j].plot(df_batch_size_deepstrom_subsample_sort["subsample_size"],
axxarr2[i][j].scatter(df_batch_size_deepstrom_subsample_sort["subsample_size"],
df_batch_size_deepstrom_subsample_sort["accuracy"],
label="Deepstrom")
label="Deepstrom", marker="x")
nb_val = len(df_batch_size_deepstrom_subsample_sort["subsample_size"])
axxarr2[i][j].plot(df_batch_size_deepstrom_subsample_sort["subsample_size"],
[df_batch_size_dense["accuracy"].values[0] for _ in range(nb_val)], color="r",
......@@ -85,9 +88,9 @@ if __name__ == '__main__':
for k, nys_dim in enumerate(subsample_size):
df_batch_size_deepstrom_nys_dim = df_batch_size_deepstrom[df_batch_size_deepstrom["subsample_size"] == nys_dim]
df_batch_size_deepstrom_nys_dim_sort = df_batch_size_deepstrom_nys_dim.sort_values(by=["deepstrom_dim"])
axxarr3[k].plot(df_batch_size_deepstrom_nys_dim_sort["deepstrom_dim"],
axxarr3[k].scatter(df_batch_size_deepstrom_nys_dim_sort["deepstrom_dim"],
df_batch_size_deepstrom_nys_dim_sort["accuracy"],
label="Deepstrom")
label="Deepstrom", marker="x")
nb_val = len(df_batch_size_deepstrom_nys_dim_sort["deepstrom_dim"])
axxarr3[k].plot(df_batch_size_deepstrom_nys_dim_sort["deepstrom_dim"],
[df_batch_size_dense["accuracy"].values[0] for _ in range(nb_val)], color="r",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment