Skip to content

Commit

Permalink
new cse 455 spring 2024 course webpage added
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjaykrishna committed Mar 22, 2024
1 parent 8b97523 commit 68c98f8
Show file tree
Hide file tree
Showing 29 changed files with 1,462 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CSE455-24sp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CSE493G1-23au
Course webpage of CSE 455 (Computer Vision) -- Spring 2024

125 changes: 125 additions & 0 deletions CSE455-24sp/assignments/assignment0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Edit page title -->
<title>Assignment 1 - CSE 455</title>
<link href="https://fonts.googleapis.com/css2?family=Assistant:wght@400;700&amp;family=Roboto+Mono:ital,wght@0,500;1,300&amp;display=swap" rel="stylesheet">

<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700' rel='stylesheet' type='text/css'>

<!-- This script dynamically loads CSS and JS files from the course base directory -->
<!-- Only edit if you want to change the paths to your JS/CSS sources -->
<script>
// Get the base path for the course web by extracting 'courses' + courseName + quarter
var fullPathArray = window.location.pathname.split('/');
var basePathArray = fullPathArray.slice(1,4);
var basePath = "/" + basePathArray.join('/') + "/";
// var basePath = 'http://localhost:8000/';

// CSS files to load
var cssSources = [
'/css/bootstrap.min.css',
'/css/main.css',
];

// Javscript files to load
var jsSources = [
'/js/jquery.min.js',
'/js/bootstrap.min.js',
'/js/nav-bar.js',
'/js/footer.js'
];

// Include the script that will load the CSS & Javscript files
document.write("<script src=\'" + basePath + "js/load-sources.js\'><\/script>");
</script>

</head>

<body>
<header class="site-header">
<!-- Javascript will load the navigation bar code here. -->
</header>

<div class="container">

<!-- Begin page content -->

<!-- Edit main page header -->

<!-- Edit main page content -->
<p><span style="color:red">We recommend you complete this assignment by <strong>Apr 04</strong> at 11:59pm PST. However, it will not contribute to your final grade.</span></p>

<p>Starter code containing Colab notebooks can be <a href="assignment0_colab.zip">downloaded here</a>.</p>

<ul>
<li><a href="#setup">Setup</a></li>
<!-- <li><a href="#goals">Goals</a></li> -->
<li><a href="#q1-k-nearest-neighbor-classifier">Q1: Intro Colab</a></li>
<li><a href="#submitting-your-work">Submitting your work</a></li>
</ul>

<h3 id="setup">Setup</h3>

<p>Please familiarize yourself with the <a href="colab_setup.html">recommended workflow</a> before starting the assignment. You should also watch the Colab walkthrough tutorial below.</p>

<!-- <iframe style="display: block; margin: auto;" width="560" height="315" src="https://www.youtube.com/embed/DsGd2e9JNH4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe> -->
<iframe src="https://drive.google.com/file/d/1lurJZZgd0fYOEPiLMvJUWzcPV1e5ktOw/preview" width="700" height="430" allow="autoplay"></iframe>

<p><br><strong>Note</strong>. Ensure you are periodically saving your notebook (<code class="language-plaintext highlighter-rouge">File -&gt; Save</code>) so that you don’t lose your progress if you step away from the assignment and the Colab VM disconnects.</p>

<p>Once you have completed all Colab notebooks (or just the single notebook for Assignment 0) <strong>except <code class="language-plaintext highlighter-rouge">collect_submission.ipynb</code></strong>, proceed to the <a href="#submitting-your-work">submission instructions</a>.</p>

<!-- <p><strong>NOTE:</strong> If you prefer to do the assignment on your local machine please see the instructions in <strong><code class="language-plaintext highlighter-rouge">README.md</code></strong> in the assignment folder first.</p> -->

<h3 id="goals">Goals</h3>

<p>In this assignment you will learn the basics of using a Google Colab and submitting to Gradescope. You will also be able to test your knowledge on some important prerequites for the course, such as familiarity with Python, matrices and calculus. The goals of this assignment are as follows:</p>


<h3 id="q1-k-nearest-neighbor-classifier">Q1: Intro</h3>

<p>The notebook <strong>intro.ipynb</strong> will allow you to test your own knowledge on important prerequisite topics for the course including Python, working with matrices and calculus. It will also allow you to become familiar with the workflow of Google Colabs and Gradescope.</p>

<h3 id="submitting-your-work">Submitting your work</h3>

<p><strong>Important</strong>. Please make sure that the submitted notebooks have been run and the cell outputs are visible.</p>

<p>Once you have completed all notebooks and filled out the necessary code, you need to follow the below instructions to submit your work:</p>

<!-- <p><span style="color:red">Even if you have completed your notebooks locally, please execute the following PDF generation on <strong>Colab</strong>. This will prevent a lot of headaches installing <code class="language-plaintext highlighter-rouge">xelatex</code> locally, specifically on Windows or Mac OS.</span></p> -->

<p><strong>1.</strong> Open <code class="language-plaintext highlighter-rouge">collect_submission.ipynb</code> in Colab and execute the notebook cells.</p>

<p>This notebook/script will:</p>

<ul>
<li>Generate a zip file of your code (<code class="language-plaintext highlighter-rouge">.py</code> and <code class="language-plaintext highlighter-rouge">.ipynb</code>) called <code class="language-plaintext highlighter-rouge">a1_code_submission.zip</code>.</li>
<li>Convert all notebooks into a single PDF file.</li>
</ul>

<p>If your submission for this step was successful, you should see the following display message:</p>

<p><code class="language-plaintext highlighter-rouge">### Done! Please submit a0_code_submission.zip and a0_inline_submission.pdf to Gradescope. ###</code></p>

<p><strong>2.</strong> Submit the PDF and the zip file to <a href="https://www.gradescope.com/courses/687869 ">Gradescope</a>.</p>

<p>Remember to download <code class="language-plaintext highlighter-rouge">a0_code_submission.zip</code> and <code class="language-plaintext highlighter-rouge">a0_inline_submission.pdf</code> locally before submitting to Gradescope.</p>

<!-- End page content -->

</div>

<footer class="site-footer">
<!-- Javascript will load the footer code here. -->
</footer>

</body>

</html>

172 changes: 172 additions & 0 deletions CSE455-24sp/assignments/colab_setup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Edit page title -->
<title>Schedule - CSE 455</title>
<link href="https://fonts.googleapis.com/css2?family=Assistant:wght@400;700&amp;family=Roboto+Mono:ital,wght@0,500;1,300&amp;display=swap" rel="stylesheet">

<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700' rel='stylesheet' type='text/css'>

<!-- This script dynamically loads CSS and JS files from the course base directory -->
<!-- Only edit if you want to change the paths to your JS/CSS sources -->
<script>
// Get the base path for the course web by extracting 'courses' + courseName + quarter
var fullPathArray = window.location.pathname.split('/');
var basePathArray = fullPathArray.slice(1,4);
var basePath = "/" + basePathArray.join('/') + "/";
// var basePath = 'http://localhost:9000/';

// CSS files to load
var cssSources = [
'/css/bootstrap.min.css',
'/css/main.css',
];

// Javscript files to load
var jsSources = [
'/js/jquery.min.js',
'/js/bootstrap.min.js',
'/js/nav-bar.js',
'/js/footer.js'
];

// Include the script that will load the CSS & Javscript files
document.write("<script src=\'" + basePath + "js/load-sources.js\'><\/script>");


</script>

</head>

<body>
<header class="site-header">
<!-- Javascript will load the navigation bar code here. -->
</header>

<div class="container">

<!-- Begin page content -->

<!-- Edit main page header -->

<!-- Edit main page content -->
<p>This year, the recommended way to work on assignments is through <a href="https://colab.research.google.com/">Google Colaboratory</a>.</p>
<!--
<ul>
<li><a href="#working-remotely-on-google-colaboratory">Working remotely on Google Colaboratory</a></li>
<li><a href="#working-locally-on-your-machine">Working locally on your machine</a>
<ul>
<li><a href="#anaconda-virtual-environment">Anaconda virtual environment</a></li>
<li><a href="#python-venv">Python venv</a></li>
<li><a href="#installing-packages">Installing packages</a></li>
</ul>
</li>
</ul> -->

<h3 id="working-remotely-on-google-colaboratory">Working remotely on Google Colaboratory</h3>

<p>Google Colaboratory is basically a combination of Jupyter notebook and Google Drive. It runs entirely in the cloud and comes
preinstalled with many packages (e.g. PyTorch and Tensorflow) so everyone has access to the same
dependencies. Even cooler is the fact that Colab benefits from free access to hardware accelerators
like GPUs (K80, P100) and TPUs which will be particularly useful for assignments 2 and 3.</p>

<p><strong>Requirements</strong>. To use Colab, you must have a Google account with an associated Google Drive. Assuming you have both, you can connect Colab to your Drive with the following steps:</p>

<ol>
<li>Click the wheel in the top right corner and select <code class="language-plaintext highlighter-rouge">Settings</code>.</li>
<li>Click on the <code class="language-plaintext highlighter-rouge">Manage Apps</code> tab.</li>
<li>At the top, select <code class="language-plaintext highlighter-rouge">Connect more apps</code> which should bring up a <code class="language-plaintext highlighter-rouge">GSuite Marketplace</code> window.</li>
<li>Search for <strong>Colab</strong> then click <code class="language-plaintext highlighter-rouge">Add</code>.</li>
</ol>

<p><strong>Workflow</strong>. Every assignment provides you with a download link to a zip file containing Colab notebooks and Python starter code. You can upload the folder to Drive, open the notebooks in Colab and work on them, then save your progress back to Drive. We encourage you to watch the tutorial video below which covers the recommended workflow using assignment 1 as an example.</p>

<!-- <iframe style="display: block; margin: auto;" width="560" height="315" src="https://www.youtube.com/embed/DsGd2e9JNH4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe> -->
<!-- <h4 id="video"><span style="color:red">Video coming soon!</span></h4> -->

<p><br><strong>Best Practices</strong>. There are a few things you should be aware of when working with Colab. The first thing to note is that resources aren’t guaranteed (this is the price for being free). If you are idle for a certain amount of time or your total connection time exceeds the maximum allowed time (~12 hours), the Colab VM will disconnect. This means any unsaved progress will be lost. <font color="red"><strong>Thus, get into the habit of frequently saving your code whilst working on assignments.</strong></font> To read more about resource limitations in Colab, read their FAQ <a href="https://research.google.com/colaboratory/faq.html">here</a>.</p>

<p><strong>Using a GPU</strong>. Using a GPU is as simple as switching the runtime in Colab. Specifically, click <code class="language-plaintext highlighter-rouge">Runtime -&gt; Change runtime type -&gt; Hardware Accelerator -&gt; GPU</code> and your Colab instance will automatically be backed by GPU compute.</p>

<p>If you’re interested in learning more about Colab, we encourage you to visit the resources below:</p>

<ul>
<li><a href="https://www.youtube.com/watch?v=inN8seMm7UI">Intro to Google Colab</a></li>
<li><a href="https://colab.research.google.com/notebooks/intro.ipynb">Welcome to Colab</a></li>
<li><a href="https://colab.research.google.com/notebooks/basic_features_overview.ipynb">Overview of Colab Features</a></li>
</ul>

<!-- <h3 id="working-locally-on-your-machine">Working locally on your machine</h3>
<p>If you wish to work locally, you should use a virtual environment. You can install one via Anaconda (recommended) or via Python’s native <code class="language-plaintext highlighter-rouge">venv</code> module. Ensure you are using Python 3.7 as <strong>we are no longer supporting Python 2</strong>.</p>
<h4 id="anaconda-virtual-environment">Anaconda virtual environment</h4>
<p>We strongly recommend using the free <a href="https://www.anaconda.com/download/">Anaconda Python distribution</a>, which provides an easy way for you to handle package dependencies. Please be sure to download the Python 3 version, which currently installs Python 3.7. The neat thing about Anaconda is that it ships with <a href="https://docs.anaconda.com/mkl-optimizations/">MKL optimizations</a> by default, which means your <code class="language-plaintext highlighter-rouge">numpy</code> and <code class="language-plaintext highlighter-rouge">scipy</code> code benefit from significant speed-ups without having to change a single line of code.</p>
<p>Once you have Anaconda installed, it makes sense to create a virtual environment for the course. If you choose not to use a virtual environment (strongly not recommended!), it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment called <code class="language-plaintext highlighter-rouge">cse493g1</code>, run the following in your terminal:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># this will create an anaconda environment</span>
<span class="c"># called cse493g1 in 'path/to/anaconda3/envs/'</span>
conda create <span class="nt">-n</span> cse493g1 <span class="nv">python</span><span class="o">=</span>3.7</code></pre></div></div>
<p>To activate and enter the environment, run <code class="language-plaintext highlighter-rouge">conda activate cse493g1</code>. To deactivate the environment, either run <code class="language-plaintext highlighter-rouge">conda deactivate cse493g1</code> or exit the terminal. Note that every time you want to work on the assignment, you should rerun <code class="language-plaintext highlighter-rouge">conda activate cse493g1</code>.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># sanity check that the path to the python</span>
<span class="c"># binary matches that of the anaconda env</span>
<span class="c"># after you activate it</span>
which python
<span class="c"># for example, on my machine, this prints</span>
<span class="c"># $ '/Users/kevin/anaconda3/envs/sci/bin/python'</span></code></pre></div></div>
<p>You may refer to <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html">this page</a> for more detailed instructions on managing virtual environments with Anaconda.</p>
<p><strong>Note:</strong> If you’ve chosen to go the Anaconda route, you can safely skip the next section and move straight to <a href="#installing-packages">Installing Packages</a>.</p>
<p><a name="venv"></a></p>
<h4 id="python-venv">Python venv</h4>
<p>As of 3.3, Python natively ships with a lightweight virtual environment module called <a href="https://docs.python.org/3/library/venv.html">venv</a>. Each virtual environment packages its own independent set of installed Python packages that are isolated from system-wide Python packages and runs a Python version that matches that of the binary that was used to create it. To set up a virtual environment called <code class="language-plaintext highlighter-rouge">cse493g1</code>, run the following in your terminal:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># this will create a virtual environment</span>
<span class="c"># called cse493g1 in your home directory</span>
python3.7 <span class="nt">-m</span> venv ~/cse493g1</code></pre></div></div>
<p>To activate and enter the environment, run <code class="language-plaintext highlighter-rouge">source ~/cse493g1/bin/activate</code>. To deactivate the environment, either run <code class="language-plaintext highlighter-rouge">deactivate</code> or exit the terminal. Note that every time you want to work on the assignment, you should rerun <code class="language-plaintext highlighter-rouge">source ~/cse493g1/bin/activate</code>.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># sanity check that the path to the python</span>
<span class="c"># binary matches that of the virtual env</span>
<span class="c"># after you activate it</span>
which python
<span class="c"># for example, on my machine, this prints</span>
<span class="c"># $ '/Users/kevin/cse493g1/bin/python'</span></code></pre></div></div>
<p><a name="packages"></a></p>
<h4 id="installing-packages">Installing packages</h4>
<p>Once you’ve <strong>setup</strong> and <strong>activated</strong> your virtual environment (via <code class="language-plaintext highlighter-rouge">conda</code> or <code class="language-plaintext highlighter-rouge">venv</code>), you should install the libraries needed to run the assignments using <code class="language-plaintext highlighter-rouge">pip</code>. To do so, run:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># again, ensure your virtual env (either conda or venv)</span>
<span class="c"># has been activated before running the commands below</span>
<span class="nb">cd </span>assignment1 <span class="c"># cd to the assignment directory</span>
<span class="c"># install assignment dependencies.</span>
<span class="c"># since the virtual env is activated,</span>
<span class="c"># this pip is associated with the</span>
<span class="c"># python binary of the environment</span>
pip <span class="nb">install</span> <span class="nt">-r</span> requirements.txt</code></pre></div></div> -->

<!-- End page content -->

</div>

<footer class="site-footer">
<!-- Javascript will load the footer code here. -->
</footer>

</body>

</html>
Loading

0 comments on commit 68c98f8

Please sign in to comment.