VS265: Homework assignments: Difference between revisions
(Created page with "Students are encouraged to work in groups, but turn in assignments ''individually'', listing the group members they worked with. '''Submission instructions''': email both a P...") |
|||
(39 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
'''Submission instructions''': | '''Submission instructions''': | ||
Only paper copies of the homework will be accepted. Solutions are due at the start of the class. Please place them on the speaker's desk at the front of the class. | |||
= Resources = | = Resources = | ||
== Matlab == | == Matlab == | ||
Student version of Matlab ($50) may be obtained [https://www.mathworks.com/store/link/products/student/?s_tid=ac_buy_sv_cta here]. | |||
There is an excellent guide to Matlab by Kevin Murphy on the web: [http://code.google.com/p/yagtom/ http://code.google.com/p/yagtom/] | |||
== Python == | == Python == | ||
Fernando Perez at the Brain Imaging Center has an | Fernando Perez at the Brain Imaging Center has an excellent set of resources on [http://fperez.org/py4science/index.html Python for scientific computing]. You will likely find the [http://fperez.org/py4science/starter_kit.html "Starter Kit"] particularly useful. | ||
Also, a great starting point for all scientific python is using Anaconda [https://store.continuum.io/cshop/anaconda/] | |||
= Assignments = | = Assignments = | ||
==== Lab #1, due | ==== Lab #1, due Tuesday, September 16 at beginning of class ==== | ||
* [http://redwood.berkeley.edu/vs265/lab1.pdf lab1.pdf] [http://redwood.berkeley.edu/ | * [http://redwood.berkeley.edu/vs265/lab1.pdf lab1.pdf] | ||
* [http://redwood.berkeley.edu/vs265/data.mat data.mat] | |||
==== Lab #2, due | ==== Lab #2, due Tuesday, September 23 at beginning of class ==== | ||
* [http://redwood.berkeley.edu/vs265/lab2.pdf lab2.pdf] | * [http://redwood.berkeley.edu/vs265/lab2.pdf lab2.pdf] | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab2s.m lab2s.m] or [http://redwood.berkeley.edu/vs265/lab2s.txt lab2s.py] | ||
* [http://redwood.berkeley.edu/vs265/apples.mat apples.mat] | * [http://redwood.berkeley.edu/vs265/apples.mat apples.mat] | ||
* [http://redwood.berkeley.edu/vs265/oranges.mat oranges.mat] | * [http://redwood.berkeley.edu/vs265/oranges.mat oranges.mat] | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab2m.m lab2m.m] | ||
* [http://redwood.berkeley.edu/vs265/apples2.mat apples2.mat] | * [http://redwood.berkeley.edu/vs265/apples2.mat apples2.mat] | ||
* [http://redwood.berkeley.edu/vs265/oranges2.mat oranges2.mat] | * [http://redwood.berkeley.edu/vs265/oranges2.mat oranges2.mat] | ||
''For Python you can use [http://redwood.berkeley.edu/vs265/apples-oranges.npz apples-oranges.npz]'' | ''For Python you can use [http://redwood.berkeley.edu/vs265/apples-oranges.npz apples-oranges.npz]'' | ||
Line 49: | Line 36: | ||
Out[3]: ['oranges2', 'apples2', 'apples', 'oranges'] | Out[3]: ['oranges2', 'apples2', 'apples', 'oranges'] | ||
==== Lab #3, due Tuesday, October 21 at beginning of class ==== | |||
* [http://redwood.berkeley.edu/vs265/lab3.pdf lab3.pdf] | |||
==== Lab # | |||
* [http://redwood.berkeley.edu/vs265/ | |||
Matlab code are as separate files below. | Matlab code are as separate files below. | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/hebb.m hebb.m] | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/eigmovie.m eigmovie.m] | ||
* [http://redwood.berkeley.edu/vs265/ | Data | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/data2d.mat data2d.mat] | ||
* [http://redwood.berkeley.edu/vs265/lab3/faces2.mat faces2.mat] | |||
''For Python you can use '' | ''For Python you can use '' | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/data2d.npz data2d.npz] (see previous assignments above for how to read this in) | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/faces2.npz faces2.npz] | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/hebb.txt hebb.py] | ||
* [http://redwood.berkeley.edu/vs265/ | * [http://redwood.berkeley.edu/vs265/lab3/eigmovie.txt eigmovie.py] | ||
==== Lab #4, due October 9th at beginning fo class ==== | |||
* [http://redwood.berkeley.edu/w/images/8/81/Vs265_fall14_hw4.pdf lab4.pdf] | |||
Matlab code and data for homework | |||
* | |||
* [http://redwood.berkeley.edu/vs265/lab7/patterns.mat patterns.mat] | * [http://redwood.berkeley.edu/vs265/lab7/patterns.mat patterns.mat] | ||
* [http://redwood.berkeley.edu/vs265/lab7/hopnet.m hopnet.m] | * [http://redwood.berkeley.edu/vs265/lab7/hopnet.m hopnet.m] | ||
Line 101: | Line 70: | ||
face,hi,X = [p[k].reshape(10,10).T.reshape(100,1) for k in 'face','hi','X'] | face,hi,X = [p[k].reshape(10,10).T.reshape(100,1) for k in 'face','hi','X'] | ||
# line above converts Fortran to C ordering | # line above converts Fortran to C ordering | ||
==== Lab #8, due | ==== Lab #5, due Thursday, Oct 30 at beginning of class ==== | ||
* [http://redwood.berkeley.edu/vs265/lab5.pdf lab5] | |||
* [http://redwood.berkeley.edu/vs265/foldiak_class_scripts.zip foldiak scripts (zip)] | |||
* [http://redwood.berkeley.edu/vs265/sparsenet_class_scripts.zip sparsenet scripts (zip)] | |||
* You will also need the following set of whitened natural movie images: [https://redwood.berkeley.edu/bruno/sparsenet/IMAGES.mat IMAGES.mat] | |||
==== Lab #6, due Thursday, Nov. 6 at beginning of class ==== | |||
* [http://redwood.berkeley.edu/vs265/lab6.pdf lab6] | |||
* [http://redwood.berkeley.edu/vs265/lab6/kohonen.m kohonen.m] | |||
* [http://redwood.berkeley.edu/vs265/lab6/showrfs.m showrfs.m] | |||
''Python code:'' | |||
* [http://redwood.berkeley.edu/vs265/lab6/kohonen.txt kohonen.py] | |||
* [http://redwood.berkeley.edu/vs265/lab6/showrfs.txt showrfs.py] | |||
==== Lab #7, due Tuesday, Nov. 25 at beginning of class ==== | |||
* [http://redwood.berkeley.edu/vs265/lab7.pdf lab7] | |||
* [http://redwood.berkeley.edu/vs265/lab7_scripts.zip lab7_scripts.zip] | |||
==== Lab #8, due Thursday, Dec. 4 at beginning of class ==== | |||
* [http://redwood.berkeley.edu/vs265/lab8.pdf lab8.pdf] | * [http://redwood.berkeley.edu/vs265/lab8.pdf lab8.pdf] | ||
* [http://redwood.berkeley.edu/vs265/boltz/boltz.m boltz.m] | * [http://redwood.berkeley.edu/vs265/boltz/boltz.m boltz.m] | ||
* [http://redwood.berkeley.edu/vs265/boltz/get_batch.m get_batch.m] | * [http://redwood.berkeley.edu/vs265/boltz/get_batch.m get_batch.m] | ||
Line 127: | Line 102: | ||
* [http://redwood.berkeley.edu/vs265/boltz/prob.m prob.m] | * [http://redwood.berkeley.edu/vs265/boltz/prob.m prob.m] | ||
* [http://redwood.berkeley.edu/vs265/boltz/show_patches.m show_patches.m] | * [http://redwood.berkeley.edu/vs265/boltz/show_patches.m show_patches.m] | ||
Latest revision as of 21:25, 23 August 2016
Students are encouraged to work in groups, but turn in assignments individually, listing the group members they worked with.
Submission instructions: Only paper copies of the homework will be accepted. Solutions are due at the start of the class. Please place them on the speaker's desk at the front of the class.
Resources
Matlab
Student version of Matlab ($50) may be obtained here.
There is an excellent guide to Matlab by Kevin Murphy on the web: http://code.google.com/p/yagtom/
Python
Fernando Perez at the Brain Imaging Center has an excellent set of resources on Python for scientific computing. You will likely find the "Starter Kit" particularly useful.
Also, a great starting point for all scientific python is using Anaconda [1]
Assignments
Lab #1, due Tuesday, September 16 at beginning of class
Lab #2, due Tuesday, September 23 at beginning of class
For Python you can use apples-oranges.npz
In [1]: import numpy as np In [2]: d = np.load('apples-oranges.npz') In [3]: d.keys() Out[3]: ['oranges2', 'apples2', 'apples', 'oranges']
Lab #3, due Tuesday, October 21 at beginning of class
Matlab code are as separate files below.
Data
For Python you can use
- data2d.npz (see previous assignments above for how to read this in)
- faces2.npz
- hebb.py
- eigmovie.py
Lab #4, due October 9th at beginning fo class
Matlab code and data for homework
Python code:
- hopnet.py - python version of the above code as one file (with run, genpat, and corrupt methods)
- patterns.npz
p = np.load('patterns.npz') face,hi,X = p['face'], p['hi'], p['X']
# if you load patterns.mat, use: p = scipy.io.loadmat("patterns.mat") face,hi,X = [p[k].reshape(10,10).T.reshape(100,1) for k in 'face','hi','X'] # line above converts Fortran to C ordering
Lab #5, due Thursday, Oct 30 at beginning of class
- lab5
- foldiak scripts (zip)
- sparsenet scripts (zip)
- You will also need the following set of whitened natural movie images: IMAGES.mat
Lab #6, due Thursday, Nov. 6 at beginning of class
Python code: