using PlotlyJS using PlotlyJS: savefig include("aux_func.jl") using LinearAlgebra #using StatsPlots using Statistics #using Plots #= Define GPU paths =# #mni_folder_1 = "ini_exp_data/" mni_folder_100 = "exp_100_epochs/"; cif_folder_100 = "CIFAR_100_epoch/"; mni_folder_acc = "data_bounded/"; cif_folder_acc = "CIFAR_acc_bound/"; mni_folder_wat = "data_budget/"; cif_folder_wat = "CIFAR_energy_bound/"; mni_folder_est = "early_stop_res/"; cif_folder_est = "CIFAR_early_stop/"; bayes_model = "bayes"; freq_model = "freq"; w_type = "watt"; e_type = "exp"; #= Load GPU data =# mni_100_bay_mem = getgpudata(mni_folder_100, bayes_model, w_type, "mo"); mni_100_fre_mem = getgpudata(mni_folder_100, freq_model, w_type, "mo"); cif_100_bay_mem = getgpudata(cif_folder_100, bayes_model, w_type, "mo"); cif_100_fre_mem = getgpudata(cif_folder_100, freq_model, w_type, "mo"); mni_acc_bay_mem = getgpudata(mni_folder_acc, bayes_model, w_type, "mo"); mni_acc_fre_mem = getgpudata(mni_folder_acc, freq_model, w_type, "mo"); cif_acc_bay_mem = getgpudata(cif_folder_acc, bayes_model, w_type, "mo"); cif_acc_fre_mem = getgpudata(cif_folder_acc, freq_model, w_type, "mo"); mni_wat_bay_mem = getgpudata(mni_folder_wat, bayes_model, w_type, "mo"); mni_wat_fre_mem = getgpudata(mni_folder_wat, freq_model, w_type, "mo"); cif_wat_bay_mem = getgpudata(cif_folder_wat, bayes_model, w_type, "mo"); cif_wat_fre_mem = getgpudata(cif_folder_wat, freq_model, w_type, "mo"); mni_est_bay_mem = getgpudata(mni_folder_est, bayes_model, w_type, "mo"); mni_est_fre_mem = getgpudata(mni_folder_est, freq_model, w_type, "mo"); cif_est_bay_mem = getgpudata(cif_folder_est, bayes_model, w_type, "mo"); cif_est_fre_mem = getgpudata(cif_folder_est, freq_model, w_type, "mo"); #= Define CPU paths =# cif = "cifar"; mni = "mnist"; bay = "bayes"; wat = "cpu_watts"; frq = "freq"; ram = "ram_use"; _100 = "100"; acc = "acc"; es = "es"; wbud = "wbud"; #= Load CPU data =# bay_cif_100_mem = readcpudata(cif, bay, ram, _100); bay_mni_100_mem = readcpudata(mni, bay, ram, _100); frq_cif_100_mem = readcpudata(cif, frq, ram, _100); frq_mni_100_mem = readcpudata(mni, frq, ram, _100); bay_cif_acc_mem = readcpudata(cif, bay, ram, acc); bay_mni_acc_mem = readcpudata(mni, bay, ram, acc); frq_cif_acc_mem = readcpudata(cif, frq, ram, acc); frq_mni_acc_mem = readcpudata(mni, frq, ram, acc); bay_cif_wbu_mem = readcpudata(cif, bay, ram, wbud); bay_mni_wbu_mem = readcpudata(mni, bay, ram, wbud); frq_cif_wbu_mem = readcpudata(cif, frq, ram, wbud); frq_mni_wbu_mem = readcpudata(mni, frq, ram, wbud); bay_mni_est_mem = readcpudata(mni, bay, ram, es); bay_cif_est_mem = readcpudata(cif, bay, ram, es); frq_cif_est_mem = readcpudata(cif, frq, ram, es); frq_mni_est_mem = readcpudata(mni, frq, ram, es); for s = 1:5 bay_cif_acc_mem[s] = round.(getramuse(bay_cif_acc_mem[s])) bay_cif_est_mem[s] = round.(getramuse(bay_cif_est_mem[s])) bay_cif_wbu_mem[s] = round.(getramuse(bay_cif_wbu_mem[s])) bay_cif_100_mem[s] = round.(getramuse(bay_cif_100_mem[s])) bay_mni_acc_mem[s] = round.(getramuse(bay_mni_acc_mem[s])) bay_mni_est_mem[s] = round.(getramuse(bay_mni_est_mem[s])) bay_mni_wbu_mem[s] = round.(getramuse(bay_mni_wbu_mem[s])) bay_mni_100_mem[s] = round.(getramuse(bay_mni_100_mem[s])) frq_cif_acc_mem[s] = round.(getramuse(frq_cif_acc_mem[s])) frq_cif_est_mem[s] = round.(getramuse(frq_cif_est_mem[s])) frq_cif_wbu_mem[s] = round.(getramuse(frq_cif_wbu_mem[s])) frq_cif_100_mem[s] = round.(getramuse(frq_cif_100_mem[s])) frq_mni_acc_mem[s] = round.(getramuse(frq_mni_acc_mem[s])) frq_mni_est_mem[s] = round.(getramuse(frq_mni_est_mem[s])) frq_mni_wbu_mem[s] = round.(getramuse(frq_mni_wbu_mem[s])) frq_mni_100_mem[s] = round.(getramuse(frq_mni_100_mem[s])) end for s = 1:5 mni_100_bay_mem[s]["Mem"] = vcat(mni_100_bay_mem[s]["Mem"], bay_mni_100_mem[s]) mni_100_fre_mem[s]["Mem"] = vcat(mni_100_fre_mem[s]["Mem"], frq_mni_100_mem[s]) cif_100_bay_mem[s]["Mem"] = vcat(cif_100_bay_mem[s]["Mem"], bay_cif_100_mem[s]) cif_100_fre_mem[s]["Mem"] = vcat(cif_100_fre_mem[s]["Mem"], frq_cif_100_mem[s]) mni_acc_bay_mem[s]["Mem"] = vcat(mni_acc_bay_mem[s]["Mem"], bay_mni_acc_mem[s]) mni_acc_fre_mem[s]["Mem"] = vcat(mni_acc_fre_mem[s]["Mem"], frq_mni_acc_mem[s]) cif_acc_bay_mem[s]["Mem"] = vcat(cif_acc_bay_mem[s]["Mem"], bay_cif_acc_mem[s]) cif_acc_fre_mem[s]["Mem"] = vcat(cif_acc_fre_mem[s]["Mem"], frq_cif_acc_mem[s]) mni_wat_bay_mem[s]["Mem"] = vcat(mni_wat_bay_mem[s]["Mem"], bay_mni_wbu_mem[s]) mni_wat_fre_mem[s]["Mem"] = vcat(mni_wat_fre_mem[s]["Mem"], frq_mni_wbu_mem[s]) cif_wat_bay_mem[s]["Mem"] = vcat(cif_wat_bay_mem[s]["Mem"], bay_cif_wbu_mem[s]) cif_wat_fre_mem[s]["Mem"] = vcat(cif_wat_fre_mem[s]["Mem"], frq_cif_wbu_mem[s]) mni_est_bay_mem[s]["Mem"] = vcat(mni_est_bay_mem[s]["Mem"], bay_mni_est_mem[s]) mni_est_fre_mem[s]["Mem"] = vcat(mni_est_fre_mem[s]["Mem"], frq_mni_est_mem[s]) cif_est_bay_mem[s]["Mem"] = vcat(cif_est_bay_mem[s]["Mem"], bay_cif_est_mem[s]) cif_est_fre_mem[s]["Mem"] = vcat(cif_est_fre_mem[s]["Mem"], frq_cif_est_mem[s]) end leng_dict = Dict( "mni" => Dict( 1 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 2 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 3 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 4 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 5 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), ), "cif" => Dict( 1 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 2 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 3 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 4 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), 5 => Dict( "100" => Dict("bay" => 0, "frq" => 0), "acc" => Dict("bay" => 0, "frq" => 0), "wat" => Dict("bay" => 0, "frq" => 0), "est" => Dict("bay" => 0, "frq" => 0), ), ), ) for s = 1:5 leng_dict["mni"][s]["100"]["bay"] = length(mni_100_bay_mem[s]["Mem"]) leng_dict["mni"][s]["100"]["frq"] = length(mni_100_fre_mem[s]["Mem"]) leng_dict["cif"][s]["100"]["bay"] = length(cif_100_bay_mem[s]["Mem"]) leng_dict["cif"][s]["100"]["frq"] = length(cif_100_fre_mem[s]["Mem"]) leng_dict["mni"][s]["acc"]["bay"] = length(mni_acc_bay_mem[s]["Mem"]) leng_dict["mni"][s]["acc"]["frq"] = length(mni_acc_fre_mem[s]["Mem"]) leng_dict["cif"][s]["acc"]["bay"] = length(cif_acc_bay_mem[s]["Mem"]) leng_dict["cif"][s]["acc"]["frq"] = length(cif_acc_fre_mem[s]["Mem"]) leng_dict["mni"][s]["wat"]["bay"] = length(mni_wat_bay_mem[s]["Mem"]) leng_dict["mni"][s]["wat"]["frq"] = length(mni_wat_fre_mem[s]["Mem"]) leng_dict["cif"][s]["wat"]["bay"] = length(cif_wat_bay_mem[s]["Mem"]) leng_dict["cif"][s]["wat"]["frq"] = length(cif_wat_fre_mem[s]["Mem"]) leng_dict["mni"][s]["est"]["bay"] = length(mni_est_bay_mem[s]["Mem"]) leng_dict["mni"][s]["est"]["frq"] = length(mni_est_fre_mem[s]["Mem"]) leng_dict["cif"][s]["est"]["bay"] = length(cif_est_bay_mem[s]["Mem"]) leng_dict["cif"][s]["est"]["frq"] = length(cif_est_fre_mem[s]["Mem"]) end io = open("sampling_rates", "w"); write(io, "MNIST bays 100 size 1: $(round(leng_dict["mni"][1]["100"]["bay"] / 599))\n") write(io, "MNIST bays 100 size 2: $(round(leng_dict["mni"][2]["100"]["bay"] / 815))\n") write(io, "MNIST bays 100 size 3: $(round(leng_dict["mni"][4]["100"]["bay"] / 1038))\n") write(io, "MNIST bays 100 size 4: $(round(leng_dict["mni"][4]["100"]["bay"] / 1284))\n") write(io, "MNIST bays 100 size 5: $(round(leng_dict["mni"][5]["100"]["bay"] / 1551))\n") write(io, "MNIST bays acc size 1: $(round(leng_dict["mni"][1]["acc"]["bay"] / 425))\n") write(io, "MNIST bays acc size 2: $(round(leng_dict["mni"][2]["acc"]["bay"] / 527))\n") write(io, "MNIST bays acc size 3: $(round(leng_dict["mni"][4]["acc"]["bay"] / 731))\n") write(io, "MNIST bays acc size 4: $(round(leng_dict["mni"][4]["acc"]["bay"] / 1013))\n") write(io, "MNIST bays acc size 5: $(round(leng_dict["mni"][5]["acc"]["bay"] / 1204))\n") write(io, "MNIST bays wat size 1: $(round(leng_dict["mni"][1]["wat"]["bay"] / 101))\n") write(io, "MNIST bays wat size 2: $(round(leng_dict["mni"][2]["wat"]["bay"] / 79))\n") write(io, "MNIST bays wat size 3: $(round(leng_dict["mni"][4]["wat"]["bay"] / 78))\n") write(io, "MNIST bays wat size 4: $(round(leng_dict["mni"][4]["wat"]["bay"] / 69))\n") write(io, "MNIST bays wat size 5: $(round(leng_dict["mni"][5]["wat"]["bay"] / 67))\n") write(io, "MNIST bays est size 1: $(round(leng_dict["mni"][1]["est"]["bay"] / 166))\n") write(io, "MNIST bays est size 2: $(round(leng_dict["mni"][2]["est"]["bay"] / 227))\n") write(io, "MNIST bays est size 3: $(round(leng_dict["mni"][4]["est"]["bay"] / 478))\n") write(io, "MNIST bays est size 4: $(round(leng_dict["mni"][4]["est"]["bay"] / 298))\n") write(io, "MNIST bays est size 5: $(round(leng_dict["mni"][5]["est"]["bay"] / 241))\n") write(io, "CIFAR bays 100 size 1: $(round(leng_dict["cif"][1]["100"]["bay"] / 504))\n") write(io, "CIFAR bays 100 size 2: $(round(leng_dict["cif"][2]["100"]["bay"] / 682))\n") write(io, "CIFAR bays 100 size 3: $(round(leng_dict["cif"][4]["100"]["bay"] / 881))\n") write(io, "CIFAR bays 100 size 4: $(round(leng_dict["cif"][4]["100"]["bay"] / 1086))\n") write(io, "CIFAR bays 100 size 5: $(round(leng_dict["cif"][5]["100"]["bay"] / 1334))\n") write(io, "CIFAR bays acc size 1: $(round(leng_dict["cif"][1]["acc"]["bay"] / 322))\n") write(io, "CIFAR bays acc size 2: $(round(leng_dict["cif"][2]["acc"]["bay"] / 273))\n") write(io, "CIFAR bays acc size 3: $(round(leng_dict["cif"][4]["acc"]["bay"] / 282))\n") write(io, "CIFAR bays acc size 4: $(round(leng_dict["cif"][4]["acc"]["bay"] / 377))\n") write(io, "CIFAR bays acc size 5: $(round(leng_dict["cif"][5]["acc"]["bay"] / 476))\n") write(io, "CIFAR bays wat size 1: $(round(leng_dict["cif"][1]["wat"]["bay"] / 74))\n") write(io, "CIFAR bays wat size 2: $(round(leng_dict["cif"][2]["wat"]["bay"] / 77))\n") write(io, "CIFAR bays wat size 3: $(round(leng_dict["cif"][4]["wat"]["bay"] / 71))\n") write(io, "CIFAR bays wat size 4: $(round(leng_dict["cif"][4]["wat"]["bay"] / 74))\n") write(io, "CIFAR bays wat size 5: $(round(leng_dict["cif"][5]["wat"]["bay"] / 72))\n") write(io, "CIFAR bays est size 1: $(round(leng_dict["cif"][1]["est"]["bay"] / 404))\n") write(io, "CIFAR bays est size 2: $(round(leng_dict["cif"][2]["est"]["bay"] / 518))\n") write(io, "CIFAR bays est size 3: $(round(leng_dict["cif"][4]["est"]["bay"] / 302))\n") write(io, "CIFAR bays est size 4: $(round(leng_dict["cif"][4]["est"]["bay"] / 449))\n") write(io, "CIFAR bays est size 5: $(round(leng_dict["cif"][5]["est"]["bay"] / 854))\n") write(io, "MNIST freq 100 size 1: $(round(leng_dict["mni"][1]["100"]["frq"] / 281))\n") write(io, "MNIST freq 100 size 2: $(round(leng_dict["mni"][2]["100"]["frq"] / 285))\n") write(io, "MNIST freq 100 size 3: $(round(leng_dict["mni"][4]["100"]["frq"] / 287))\n") write(io, "MNIST freq 100 size 4: $(round(leng_dict["mni"][4]["100"]["frq"] / 287))\n") write(io, "MNIST freq 100 size 5: $(round(leng_dict["mni"][5]["100"]["frq"] / 299))\n") write(io, "MNIST freq acc size 1: $(round(leng_dict["mni"][1]["acc"]["frq"] / 39))\n") write(io, "MNIST freq acc size 2: $(round(leng_dict["mni"][2]["acc"]["frq"] / 23))\n") write(io, "MNIST freq acc size 3: $(round(leng_dict["mni"][4]["acc"]["frq"] / 20))\n") write(io, "MNIST freq acc size 4: $(round(leng_dict["mni"][4]["acc"]["frq"] / 17))\n") write(io, "MNIST freq acc size 5: $(round(leng_dict["mni"][5]["acc"]["frq"] / 15))\n") write(io, "MNIST freq wat size 1: $(round(leng_dict["mni"][1]["wat"]["frq"] / 79))\n") write(io, "MNIST freq wat size 2: $(round(leng_dict["mni"][2]["wat"]["frq"] / 76))\n") write(io, "MNIST freq wat size 3: $(round(leng_dict["mni"][4]["wat"]["frq"] / 71))\n") write(io, "MNIST freq wat size 4: $(round(leng_dict["mni"][4]["wat"]["frq"] / 59))\n") write(io, "MNIST freq wat size 5: $(round(leng_dict["mni"][5]["wat"]["frq"] / 47))\n") write(io, "MNIST freq est size 1: $(round(leng_dict["mni"][1]["est"]["frq"] / 37))\n") write(io, "MNIST freq est size 2: $(round(leng_dict["mni"][2]["est"]["frq"] / 69))\n") write(io, "MNIST freq est size 3: $(round(leng_dict["mni"][4]["est"]["frq"] / 25))\n") write(io, "MNIST freq est size 4: $(round(leng_dict["mni"][4]["est"]["frq"] / 70))\n") write(io, "MNIST freq est size 5: $(round(leng_dict["mni"][5]["est"]["frq"] / 36))\n") write(io, "CIFAR freq 100 size 1: $(round(leng_dict["cif"][1]["100"]["frq"] / 341))\n") write(io, "CIFAR freq 100 size 2: $(round(leng_dict["cif"][2]["100"]["frq"] / 344))\n") write(io, "CIFAR freq 100 size 3: $(round(leng_dict["cif"][4]["100"]["frq"] / 339))\n") write(io, "CIFAR freq 100 size 4: $(round(leng_dict["cif"][4]["100"]["frq"] / 344))\n") write(io, "CIFAR freq 100 size 5: $(round(leng_dict["cif"][5]["100"]["frq"] / 348))\n") write(io, "CIFAR freq acc size 1: $(round(leng_dict["cif"][1]["acc"]["frq"] / 29))\n") write(io, "CIFAR freq acc size 2: $(round(leng_dict["cif"][2]["acc"]["frq"] / 23))\n") write(io, "CIFAR freq acc size 3: $(round(leng_dict["cif"][4]["acc"]["frq"] / 16))\n") write(io, "CIFAR freq acc size 4: $(round(leng_dict["cif"][4]["acc"]["frq"] / 15))\n") write(io, "CIFAR freq acc size 5: $(round(leng_dict["cif"][5]["acc"]["frq"] / 15))\n") write(io, "CIFAR freq wat size 1: $(round(leng_dict["cif"][1]["wat"]["frq"] / 81))\n") write(io, "CIFAR freq wat size 2: $(round(leng_dict["cif"][2]["wat"]["frq"] / 80))\n") write(io, "CIFAR freq wat size 3: $(round(leng_dict["cif"][4]["wat"]["frq"] / 76))\n") write(io, "CIFAR freq wat size 4: $(round(leng_dict["cif"][4]["wat"]["frq"] / 72))\n") write(io, "CIFAR freq wat size 5: $(round(leng_dict["cif"][5]["wat"]["frq"] / 59))\n") write(io, "CIFAR freq est size 1: $(round(leng_dict["cif"][1]["est"]["frq"] / 99))\n") write(io, "CIFAR freq est size 2: $(round(leng_dict["cif"][2]["est"]["frq"] / 300))\n") write(io, "CIFAR freq est size 3: $(round(leng_dict["cif"][4]["est"]["frq"] / 86))\n") write(io, "CIFAR freq est size 4: $(round(leng_dict["cif"][4]["est"]["frq"] / 115))\n") write(io, "CIFAR freq est size 5: $(round(leng_dict["cif"][5]["est"]["frq"] / 113))\n") close(io); mean([ round(leng_dict["mni"][1]["100"]["bay"] / 599), round(leng_dict["mni"][2]["100"]["bay"] / 815), round(leng_dict["mni"][4]["100"]["bay"] / 1038), round(leng_dict["mni"][4]["100"]["bay"] / 1284), round(leng_dict["mni"][5]["100"]["bay"] / 1551), round(leng_dict["mni"][1]["acc"]["bay"] / 425), round(leng_dict["mni"][2]["acc"]["bay"] / 527), round(leng_dict["mni"][4]["acc"]["bay"] / 731), round(leng_dict["mni"][4]["acc"]["bay"] / 1013), round(leng_dict["mni"][5]["acc"]["bay"] / 1204), round(leng_dict["mni"][1]["wat"]["bay"] / 101), round(leng_dict["mni"][2]["wat"]["bay"] / 79), round(leng_dict["mni"][4]["wat"]["bay"] / 78), round(leng_dict["mni"][4]["wat"]["bay"] / 69), round(leng_dict["mni"][5]["wat"]["bay"] / 67), round(leng_dict["mni"][1]["est"]["bay"] / 166), round(leng_dict["mni"][2]["est"]["bay"] / 227), round(leng_dict["mni"][4]["est"]["bay"] / 478), round(leng_dict["mni"][4]["est"]["bay"] / 298), round(leng_dict["mni"][5]["est"]["bay"] / 241), round(leng_dict["cif"][1]["100"]["bay"] / 504), round(leng_dict["cif"][2]["100"]["bay"] / 682), round(leng_dict["cif"][4]["100"]["bay"] / 881), round(leng_dict["cif"][4]["100"]["bay"] / 1086), round(leng_dict["cif"][5]["100"]["bay"] / 1334), round(leng_dict["cif"][1]["acc"]["bay"] / 322), round(leng_dict["cif"][2]["acc"]["bay"] / 273), round(leng_dict["cif"][4]["acc"]["bay"] / 282), round(leng_dict["cif"][4]["acc"]["bay"] / 377), round(leng_dict["cif"][5]["acc"]["bay"] / 476), round(leng_dict["cif"][1]["wat"]["bay"] / 74), round(leng_dict["cif"][2]["wat"]["bay"] / 77), round(leng_dict["cif"][4]["wat"]["bay"] / 71), round(leng_dict["cif"][4]["wat"]["bay"] / 74), round(leng_dict["cif"][5]["wat"]["bay"] / 72), round(leng_dict["cif"][1]["est"]["bay"] / 404), round(leng_dict["cif"][2]["est"]["bay"] / 518), round(leng_dict["cif"][4]["est"]["bay"] / 302), round(leng_dict["cif"][4]["est"]["bay"] / 449), round(leng_dict["cif"][5]["est"]["bay"] / 854), round(leng_dict["mni"][1]["100"]["frq"] / 281), round(leng_dict["mni"][2]["100"]["frq"] / 285), round(leng_dict["mni"][4]["100"]["frq"] / 287), round(leng_dict["mni"][4]["100"]["frq"] / 287), round(leng_dict["mni"][5]["100"]["frq"] / 299), round(leng_dict["mni"][1]["acc"]["frq"] / 39), round(leng_dict["mni"][2]["acc"]["frq"] / 23), round(leng_dict["mni"][4]["acc"]["frq"] / 20), round(leng_dict["mni"][4]["acc"]["frq"] / 17), round(leng_dict["mni"][5]["acc"]["frq"] / 15), round(leng_dict["mni"][1]["wat"]["frq"] / 79), round(leng_dict["mni"][2]["wat"]["frq"] / 76), round(leng_dict["mni"][4]["wat"]["frq"] / 71), round(leng_dict["mni"][4]["wat"]["frq"] / 59), round(leng_dict["mni"][5]["wat"]["frq"] / 47), round(leng_dict["mni"][1]["est"]["frq"] / 37), round(leng_dict["mni"][2]["est"]["frq"] / 69), round(leng_dict["mni"][4]["est"]["frq"] / 25), round(leng_dict["mni"][4]["est"]["frq"] / 70), round(leng_dict["mni"][5]["est"]["frq"] / 36), round(leng_dict["cif"][1]["100"]["frq"] / 341), round(leng_dict["cif"][2]["100"]["frq"] / 344), round(leng_dict["cif"][4]["100"]["frq"] / 339), round(leng_dict["cif"][4]["100"]["frq"] / 344), round(leng_dict["cif"][5]["100"]["frq"] / 348), round(leng_dict["cif"][1]["acc"]["frq"] / 29), round(leng_dict["cif"][2]["acc"]["frq"] / 23), round(leng_dict["cif"][4]["acc"]["frq"] / 16), round(leng_dict["cif"][4]["acc"]["frq"] / 15), round(leng_dict["cif"][5]["acc"]["frq"] / 15), round(leng_dict["cif"][1]["wat"]["frq"] / 81), round(leng_dict["cif"][2]["wat"]["frq"] / 80), round(leng_dict["cif"][4]["wat"]["frq"] / 76), round(leng_dict["cif"][4]["wat"]["frq"] / 72), round(leng_dict["cif"][5]["wat"]["frq"] / 59), round(leng_dict["cif"][1]["est"]["frq"] / 99), round(leng_dict["cif"][2]["est"]["frq"] / 300), round(leng_dict["cif"][4]["est"]["frq"] / 86), round(leng_dict["cif"][4]["est"]["frq"] / 115), round(leng_dict["cif"][5]["est"]["frq"] / 113), ]) plot_dict = Dict( "mni" => Dict( 1 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 2 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 3 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 4 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 5 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), ), "cif" => Dict( 1 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 2 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 3 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 4 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), 5 => Dict( "100" => Dict("bay" => ([], []), "frq" => ([], [])), "acc" => Dict("bay" => ([], []), "frq" => ([], [])), "wat" => Dict("bay" => ([], []), "frq" => ([], [])), "est" => Dict("bay" => ([], []), "frq" => ([], [])), ), ), ) for s = 1:5 plot_dict["mni"][s]["100"]["bay"] = getuniquevalues(mni_100_bay_mem[s]["Mem"]) plot_dict["mni"][s]["100"]["frq"] = getuniquevalues(mni_100_fre_mem[s]["Mem"]) plot_dict["cif"][s]["100"]["bay"] = getuniquevalues(cif_100_bay_mem[s]["Mem"]) plot_dict["cif"][s]["100"]["frq"] = getuniquevalues(cif_100_fre_mem[s]["Mem"]) plot_dict["mni"][s]["acc"]["bay"] = getuniquevalues(mni_acc_bay_mem[s]["Mem"]) plot_dict["mni"][s]["acc"]["frq"] = getuniquevalues(mni_acc_fre_mem[s]["Mem"]) plot_dict["cif"][s]["acc"]["bay"] = getuniquevalues(cif_acc_bay_mem[s]["Mem"]) plot_dict["cif"][s]["acc"]["frq"] = getuniquevalues(cif_acc_fre_mem[s]["Mem"]) plot_dict["mni"][s]["wat"]["bay"] = getuniquevalues(mni_wat_bay_mem[s]["Mem"]) plot_dict["mni"][s]["wat"]["frq"] = getuniquevalues(mni_wat_fre_mem[s]["Mem"]) plot_dict["cif"][s]["wat"]["bay"] = getuniquevalues(cif_wat_bay_mem[s]["Mem"]) plot_dict["cif"][s]["wat"]["frq"] = getuniquevalues(cif_wat_fre_mem[s]["Mem"]) plot_dict["mni"][s]["est"]["bay"] = getuniquevalues(mni_est_bay_mem[s]["Mem"]) plot_dict["mni"][s]["est"]["frq"] = getuniquevalues(mni_est_fre_mem[s]["Mem"]) plot_dict["cif"][s]["est"]["bay"] = getuniquevalues(cif_est_bay_mem[s]["Mem"]) plot_dict["cif"][s]["est"]["frq"] = getuniquevalues(cif_est_fre_mem[s]["Mem"]) end #= # Plot data =# en_plot = plot( [ bar( x = plot_dict["mni"][1]["100"]["frq"][1], y = normalize(plot_dict["mni"][1]["100"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["100"]["frq"][1], y = normalize(plot_dict["mni"][2]["100"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["100"]["frq"][1], y = normalize(plot_dict["mni"][3]["100"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["100"]["frq"][1], y = normalize(plot_dict["mni"][4]["100"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["100"]["frq"][1], y = normalize(plot_dict["mni"][5]["100"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][1]["100"]["bay"][1], y = normalize(plot_dict["mni"][1]["100"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["100"]["bay"][1], y = normalize(plot_dict["mni"][2]["100"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["100"]["bay"][1], y = normalize(plot_dict["mni"][3]["100"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["100"]["bay"][1], y = normalize(plot_dict["mni"][4]["100"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["100"]["bay"][1], y = normalize(plot_dict["mni"][5]["100"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Samples", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "mnist_100_mem.png") en_plot = plot( [ bar( x = plot_dict["cif"][1]["100"]["frq"][1], y = normalize(plot_dict["cif"][1]["100"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["100"]["frq"][1], y = normalize(plot_dict["cif"][2]["100"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["100"]["frq"][1], y = normalize(plot_dict["cif"][3]["100"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["100"]["frq"][1], y = normalize(plot_dict["cif"][4]["100"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["100"]["frq"][1], y = normalize(plot_dict["cif"][5]["100"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][1]["100"]["bay"][1], y = normalize(plot_dict["cif"][1]["100"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["100"]["bay"][1], y = normalize(plot_dict["cif"][2]["100"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["100"]["bay"][1], y = normalize(plot_dict["cif"][3]["100"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["100"]["bay"][1], y = normalize(plot_dict["cif"][4]["100"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["100"]["bay"][1], y = normalize(plot_dict["cif"][5]["100"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Samples", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "cifar_100_mem.png") en_plot = plot( [ bar( x = plot_dict["mni"][1]["est"]["frq"][1], y = normalize(plot_dict["mni"][1]["est"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["est"]["frq"][1], y = normalize(plot_dict["mni"][2]["est"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["est"]["frq"][1], y = normalize(plot_dict["mni"][3]["est"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["est"]["frq"][1], y = normalize(plot_dict["mni"][4]["est"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["est"]["frq"][1], y = normalize(plot_dict["mni"][5]["est"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][1]["est"]["bay"][1], y = normalize(plot_dict["mni"][1]["est"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["est"]["bay"][1], y = normalize(plot_dict["mni"][2]["est"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["est"]["bay"][1], y = normalize(plot_dict["mni"][3]["est"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["est"]["bay"][1], y = normalize(plot_dict["mni"][4]["est"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["est"]["bay"][1], y = normalize(plot_dict["mni"][5]["est"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Samples %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "mnist_es_mem.png") en_plot = plot( [ bar( x = plot_dict["cif"][1]["est"]["frq"][1], y = normalize(plot_dict["cif"][1]["est"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["est"]["frq"][1], y = normalize(plot_dict["cif"][2]["est"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["est"]["frq"][1], y = normalize(plot_dict["cif"][3]["est"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["est"]["frq"][1], y = normalize(plot_dict["cif"][4]["est"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["est"]["frq"][1], y = normalize(plot_dict["cif"][5]["est"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][1]["est"]["bay"][1], y = normalize(plot_dict["cif"][1]["est"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["est"]["bay"][1], y = normalize(plot_dict["cif"][2]["est"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["est"]["bay"][1], y = normalize(plot_dict["cif"][3]["est"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["est"]["bay"][1], y = normalize(plot_dict["cif"][4]["est"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["est"]["bay"][1], y = normalize(plot_dict["cif"][5]["est"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Sample %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "cifar_es_mem.png") en_plot = plot( [ bar( x = plot_dict["mni"][5]["acc"]["frq"][1], y = normalize(plot_dict["mni"][5]["acc"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["acc"]["frq"][1], y = normalize(plot_dict["mni"][5]["acc"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["acc"]["frq"][1], y = normalize(plot_dict["mni"][5]["acc"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["acc"]["frq"][1], y = normalize(plot_dict["mni"][5]["acc"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["acc"]["frq"][1], y = normalize(plot_dict["mni"][5]["acc"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][1]["acc"]["bay"][1], y = normalize(plot_dict["mni"][1]["acc"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["acc"]["bay"][1], y = normalize(plot_dict["mni"][2]["acc"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["acc"]["bay"][1], y = normalize(plot_dict["mni"][3]["acc"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["acc"]["bay"][1], y = normalize(plot_dict["mni"][4]["acc"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["acc"]["bay"][1], y = normalize(plot_dict["mni"][5]["acc"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Sample %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "mnist_ab_mem.png") en_plot = plot( [ bar( x = plot_dict["cif"][1]["acc"]["frq"][1], y = normalize(plot_dict["cif"][1]["acc"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["acc"]["frq"][1], y = normalize(plot_dict["cif"][2]["acc"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["acc"]["frq"][1], y = normalize(plot_dict["cif"][3]["acc"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["acc"]["frq"][1], y = normalize(plot_dict["cif"][4]["acc"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["acc"]["frq"][1], y = normalize(plot_dict["cif"][5]["acc"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][1]["acc"]["bay"][1], y = normalize(plot_dict["cif"][1]["acc"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["acc"]["bay"][1], y = normalize(plot_dict["cif"][2]["acc"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["acc"]["bay"][1], y = normalize(plot_dict["cif"][3]["acc"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["acc"]["bay"][1], y = normalize(plot_dict["cif"][4]["acc"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["acc"]["bay"][1], y = normalize(plot_dict["cif"][5]["acc"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Sample %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "cifar_ab_mem.png") en_plot = plot( [ bar( x = plot_dict["mni"][1]["wat"]["frq"][1], y = normalize(plot_dict["mni"][1]["wat"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["wat"]["frq"][1], y = normalize(plot_dict["mni"][2]["wat"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["wat"]["frq"][1], y = normalize(plot_dict["mni"][3]["wat"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["wat"]["frq"][1], y = normalize(plot_dict["mni"][4]["wat"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["wat"]["frq"][1], y = normalize(plot_dict["mni"][5]["wat"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][1]["wat"]["bay"][1], y = normalize(plot_dict["mni"][1]["wat"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][2]["wat"]["bay"][1], y = normalize(plot_dict["mni"][2]["wat"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][3]["wat"]["bay"][1], y = normalize(plot_dict["mni"][3]["wat"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][4]["wat"]["bay"][1], y = normalize(plot_dict["mni"][4]["wat"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["mni"][5]["wat"]["bay"][1], y = normalize(plot_dict["mni"][5]["wat"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Sample %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "mnist_eb_mem.png") en_plot = plot( [ bar( x = plot_dict["cif"][1]["wat"]["frq"][1], y = normalize(plot_dict["cif"][1]["wat"]["frq"][2]), name = "LeNet 1", marker = attr( color = "rgb(211,120,000)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["wat"]["frq"][1], y = normalize(plot_dict["cif"][2]["wat"]["frq"][2]), name = "LeNet 2", marker = attr( color = "rgb(255,170,017)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["wat"]["frq"][1], y = normalize(plot_dict["cif"][3]["wat"]["frq"][2]), name = "LeNet 3", marker = attr( color = "rgb(255,187,034)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["wat"]["frq"][1], y = normalize(plot_dict["cif"][4]["wat"]["frq"][2]), name = "LeNet 4", marker = attr( color = "rgb(255,204,051)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["wat"]["frq"][1], y = normalize(plot_dict["cif"][5]["wat"]["frq"][2]), name = "LeNet 5", marker = attr( color = "rgb(255,221,068)", line_color = "rgb(200,100,000)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][1]["wat"]["bay"][1], y = normalize(plot_dict["cif"][1]["wat"]["bay"][2]), name = "BCNN 1", marker = attr( color = "rgb(055,033,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][2]["wat"]["bay"][1], y = normalize(plot_dict["cif"][2]["wat"]["bay"][2]), name = "BCNN 2", marker = attr( color = "rgb(033,081,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][3]["wat"]["bay"][1], y = normalize(plot_dict["cif"][3]["wat"]["bay"][2]), name = "BCNN 3", marker = attr( color = "rgb(033,115,240)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][4]["wat"]["bay"][1], y = normalize(plot_dict["cif"][4]["wat"]["bay"][2]), name = "BCNN 4", marker = attr( color = "rgb(151,177,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), bar( x = plot_dict["cif"][5]["wat"]["bay"][1], y = normalize(plot_dict["cif"][5]["wat"]["bay"][2]), name = "BCNN 5", marker = attr( color = "rgb(051,215,255)", line_color = "rgb(065,043,250)", line_width = 1.0, opacity = 0.4, ), ), ], Layout( barmode = "overlay", xaxis_tickangle = -45, yaxis_title_text = "Sample %", xaxis_title_text = "Watt"; yaxis_range = [0, 1], ), ) savefig(en_plot, "cifar_eb_mem.png")