Skip to content

Commit cb9a090

Browse files
Merge pull request #7 from PREPONDERANCE/dev
Finish assignment 2
2 parents a823b74 + 1f3e097 commit cb9a090

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+41590
-0
lines changed

assignments/assignment2/BatchNormalization.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

assignments/assignment2/ConvolutionalNetworks.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

assignments/assignment2/Dropout.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

assignments/assignment2/FullyConnectedNets.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

assignments/assignment2/PyTorch.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
#NOTE: DO NOT EDIT THIS FILE-- MAY RESULT IN INCOMPLETE SUBMISSIONS
3+
set -euo pipefail
4+
5+
CODE=(
6+
"cs231n/layers.py"
7+
"cs231n/classifiers/fc_net.py"
8+
"cs231n/optim.py"
9+
"cs231n/solver.py"
10+
"cs231n/classifiers/cnn.py"
11+
)
12+
13+
# these notebooks should ideally
14+
# be in order of questions so
15+
# that the generated pdf is
16+
# in order of questions
17+
NOTEBOOKS=(
18+
"FullyConnectedNets.ipynb"
19+
"BatchNormalization.ipynb"
20+
"Dropout.ipynb"
21+
"ConvolutionalNetworks.ipynb"
22+
"PyTorch.ipynb"
23+
)
24+
25+
FILES=( "${CODE[@]}" "${NOTEBOOKS[@]}" )
26+
27+
LOCAL_DIR=`pwd`
28+
ASSIGNMENT_NO=2
29+
ZIP_FILENAME="a2_code_submission.zip"
30+
PDF_FILENAME="a2_inline_submission.pdf"
31+
32+
C_R="\e[31m"
33+
C_G="\e[32m"
34+
C_BLD="\e[1m"
35+
C_E="\e[0m"
36+
37+
for FILE in "${FILES[@]}"
38+
do
39+
if [ ! -f ${FILE} ]; then
40+
echo -e "${C_R}Required file ${FILE} not found, Exiting.${C_E}"
41+
exit 0
42+
fi
43+
done
44+
45+
echo -e "### Zipping file ###"
46+
rm -f ${ZIP_FILENAME}
47+
zip -q "${ZIP_FILENAME}" -r ${NOTEBOOKS[@]} $(find . -name "*.py") $(find . -name "*.pyx") -x "makepdf.py"
48+
49+
echo -e "### Creating PDFs ###"
50+
python makepdf.py --notebooks "${NOTEBOOKS[@]}" --pdf_filename "${PDF_FILENAME}"
51+
52+
echo -e "### Done! Please submit ${ZIP_FILENAME} and ${PDF_FILENAME} to Gradescope. ###"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "8816fc29",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"from google.colab import drive\n",
11+
"\n",
12+
"drive.mount('/content/drive')\n",
13+
"\n",
14+
"# TODO: Enter the path in your Drive of the assignment.\n",
15+
"# e.g. 'cs231n/assignments/assignment2/'\n",
16+
"FOLDERNAME = None\n",
17+
"\n",
18+
"assert FOLDERNAME is not None, \"[!] Enter the foldername.\""
19+
]
20+
},
21+
{
22+
"attachments": {},
23+
"cell_type": "markdown",
24+
"id": "355916a9",
25+
"metadata": {},
26+
"source": [
27+
"# Collect Submission - Zip + Generate PDF \n",
28+
"\n",
29+
"Run this notebook once you have completed all the other notebooks: `FullyConnectedNets.ipynb`, `BatchNormalization.ipynb`, `Dropout.ipynb`, `ConvolutionalNetworks.ipynb`, `PyTorch.ipynb`).\n",
30+
"\n",
31+
"It will:\n",
32+
"\n",
33+
"* Generate a zip file of your code (`.py` and `.ipynb`) called `a2_code_submission.zip`.\n",
34+
"* Convert all notebooks into a single PDF file called `a2_inline_submission.pdf`.\n",
35+
"\n",
36+
"If your submission for this step was successful, you should see the following display message:\n",
37+
"\n",
38+
"`### Done! Please submit a2_code_submission.zip and the a2_inline_submission.pdf to Gradescope. ###`\n",
39+
"\n",
40+
"Make sure to download the zip and pdf file locally to your computer, then submit to Gradescope. Congrats on succesfully completing the assignment!"
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"id": "12f7cf79",
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"%cd drive/My\\ Drive/$FOLDERNAME\n",
51+
"!sudo apt-get update\n",
52+
"!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic\n",
53+
"!pip install PyPDF2\n",
54+
"!bash collectSubmission.sh"
55+
]
56+
}
57+
],
58+
"metadata": {},
59+
"nbformat": 4,
60+
"nbformat_minor": 5
61+
}

assignments/assignment2/cs231n/__init__.py

Whitespace-only changes.
Binary file not shown.

0 commit comments

Comments
 (0)