Commit 313c6698 authored by Agrawal's avatar Agrawal
Browse files

Add templates and function to make tex report.

parent 560a887f
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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]
@@ -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
+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}
+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