User Tools

Site Tools


cs501r_f2018:lab2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cs501r_f2018:lab2 [2018/09/10 18:24]
wingated
cs501r_f2018:lab2 [2018/09/10 18:39]
wingated
Line 7: Line 7:
  
 For this lab, you will submit an ipython notebook via learningsuite. This lab will be mostly boilerplate code, but you will be required to implement a few extras. For this lab, you will submit an ipython notebook via learningsuite. This lab will be mostly boilerplate code, but you will be required to implement a few extras.
 +
 +**NOTE: you almost certainly will not understand most of what's going on in this lab!  That's ok - the point is just to get you going with pytorch. ​ We'll be working on developing a deeper understanding of every part of this code over the course of the next two weeks.**
  
 A major goal of this lab is to help you become conversant in working through pytorch tutorials and documentation. ​ So, you should feel free to google whatever you want and need! A major goal of this lab is to help you become conversant in working through pytorch tutorials and documentation. ​ So, you should feel free to google whatever you want and need!
Line 22: Line 24:
 The resulting image could, for example, look like this: The resulting image could, for example, look like this:
  
-{{ :​cs501r_f2018:​lab2.png?200|}}+{{:​cs501r_f2018:​lab2.png |}}
  
 See the assigned readings for pointers to documentation on pytorch. See the assigned readings for pointers to documentation on pytorch.
Line 89: Line 91:
  
 assert torch.cuda.is_available() # You need to request a GPU from Runtime > Change Runtime Type assert torch.cuda.is_available() # You need to request a GPU from Runtime > Change Runtime Type
-</​code ​python>+</​code>​
  
-**Step 4.** Construct  ​a model class that inherits from “nn.Module” ​+**Step 4.** Construct  ​
  
-Check out [[https://​pytorch.org/​docs/​stable/​nn.html#​torch.nn.Module]] +- a model class that inherits from “nn.Module”  
-  +  * Check out [[https://​pytorch.org/​docs/​stable/​nn.html#​torch.nn.Module]] 
- Your model can contain any submodules you wish -- nn.Linear is a good, easy, starting point +  ​* ​Your model can contain any submodules you wish -- nn.Linear is a good, easy, starting point 
-a dataset class that inherits from “Dataset” and produces samples from  +a dataset class that inherits from “Dataset” and produces samples from [[https://​pytorch.org/​docs/​stable/​torchvision/​datasets.html#​fashion-mnist]] 
-https://​pytorch.org/​docs/​stable/​torchvision/​datasets.html#​fashion-mnist +  ​* ​You may be tempted to use this dataset directly (as it already inherits from Dataset) but we want you to learn how a dataset is constructed. Your class should be pretty simple and output items from FashionMNIST
-You may be tempted to use this dataset directly (as it already inherits from Dataset) but we want you to learn how a dataset is constructed. Your class should be pretty simple and output items from FashionMNIST+
  
 **Step 5.** Create instances of the following objects: **Step 5.** Create instances of the following objects:
Line 112: Line 113:
   * compute the loss between your model and the true value   * compute the loss between your model and the true value
   * take a step on the optimizer   * take a step on the optimizer
- 
----- 
-====Hints:​==== 
- 
-The following python functions might be helpful: 
- 
-<code python> 
- 
- 
-</​code>​ 
  
cs501r_f2018/lab2.txt · Last modified: 2021/06/30 23:42 (external edit)