Loading torch_experiments/report/main.py +21 −0 Original line number Diff line number Diff line Loading @@ -82,8 +82,27 @@ def learning_curves(dataset, depth, width): plt.close() def tex(dataset, dataset_name, lc_depths, lc_widths): lc_sections = "" for d in lc_depths: for w in lc_widths: with open("templates/lc.tex", "r") as fp: lcs = fp.read() lcs = lcs.replace("%depth%", str(int(d))) lcs = lcs.replace("%width%", str(int(w))) lc_sections = lc_sections + lcs with open("templates/main.tex", "r") as fp: main_text = fp.read() main_text = main_text.replace("%lcsections%", lc_sections) main_text = main_text.replace("%dataset%", dataset) main_text = main_text.replace("%datasetname%", dataset_name) with open(dataset+".tex", "w") as fp: fp.write(main_text) if __name__ == "__main__": dataset = "boston" dataset_name = "Boston housing prices" hm_depths = [10*i for i in range(1, 10)] hm_widths = [4, 16, 64, 256] Loading @@ -95,5 +114,7 @@ if __name__ == "__main__": for w in lc_widths: learning_curves(dataset, d, w) tex(dataset, dataset_name, lc_depths, lc_widths) print("Done!") No newline at end of file torch_experiments/report/templates/lc.tex 0 → 100644 +9 −0 Original line number Diff line number Diff line \newpage \section*{Depth %depth% width %width%} \begin{tabular}{cc} \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/loss.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/delta_loss.png} \\ \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/params.png} & % \quad \\ \end{tabular} torch_experiments/report/templates/main.tex 0 → 100644 +26 −0 Original line number Diff line number Diff line \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{graphicx} \usepackage{hyperref} \usepackage{booktabs} \usepackage{makecell} \title{Bottleneck NNGP MML \\ Dataset: %datasetname%} \author{Devanshu Agrawal} \date{\today} \begin{document} \maketitle \begin{tabular}{cc} \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/loss.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_b.png} \\ \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_w.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_n.png} \\ \end{tabular} %lcsections% \end{document} No newline at end of file Loading
torch_experiments/report/main.py +21 −0 Original line number Diff line number Diff line Loading @@ -82,8 +82,27 @@ def learning_curves(dataset, depth, width): plt.close() def tex(dataset, dataset_name, lc_depths, lc_widths): lc_sections = "" for d in lc_depths: for w in lc_widths: with open("templates/lc.tex", "r") as fp: lcs = fp.read() lcs = lcs.replace("%depth%", str(int(d))) lcs = lcs.replace("%width%", str(int(w))) lc_sections = lc_sections + lcs with open("templates/main.tex", "r") as fp: main_text = fp.read() main_text = main_text.replace("%lcsections%", lc_sections) main_text = main_text.replace("%dataset%", dataset) main_text = main_text.replace("%datasetname%", dataset_name) with open(dataset+".tex", "w") as fp: fp.write(main_text) if __name__ == "__main__": dataset = "boston" dataset_name = "Boston housing prices" hm_depths = [10*i for i in range(1, 10)] hm_widths = [4, 16, 64, 256] Loading @@ -95,5 +114,7 @@ if __name__ == "__main__": for w in lc_widths: learning_curves(dataset, d, w) tex(dataset, dataset_name, lc_depths, lc_widths) print("Done!") No newline at end of file
torch_experiments/report/templates/lc.tex 0 → 100644 +9 −0 Original line number Diff line number Diff line \newpage \section*{Depth %depth% width %width%} \begin{tabular}{cc} \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/loss.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/delta_loss.png} \\ \includegraphics[width=0.5\linewidth]{figs/%dataset%/lc/d%depth%w%width%/params.png} & % \quad \\ \end{tabular}
torch_experiments/report/templates/main.tex 0 → 100644 +26 −0 Original line number Diff line number Diff line \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{graphicx} \usepackage{hyperref} \usepackage{booktabs} \usepackage{makecell} \title{Bottleneck NNGP MML \\ Dataset: %datasetname%} \author{Devanshu Agrawal} \date{\today} \begin{document} \maketitle \begin{tabular}{cc} \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/loss.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_b.png} \\ \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_w.png} & % \includegraphics[width=0.5\linewidth]{figs/%dataset%/hm/v_n.png} \\ \end{tabular} %lcsections% \end{document} No newline at end of file