VS265: Homework assignments: Difference between revisions

From RedwoodCenter
Jump to navigationJump to search
Line 125: Line 125:
''Python code:''
''Python code:''
* [http://redwood.berkeley.edu/vs265/lab9/boltz.txt boltz.py] - python version of the above code with solution.
* [http://redwood.berkeley.edu/vs265/lab9/boltz.txt boltz.py] - python version of the above code with solution.
Solutions
* [https://www.dropbox.com/sh/q9hb1igr7pgmjld/AAB8x5kL4iNyQG1IuEdErSywa?dl=0 Solution Folder]
<!-- * [http://redwood.berkeley.edu/w/images/9/9c/Lab9_soln.pdf Writeup with code] -->
<!-- * [http://redwood.berkeley.edu/w/images/9/9c/Lab9_soln.pdf Writeup with code] -->

Revision as of 21:50, 21 December 2014

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

Solutions

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']

Solutions

Lab #3, due Tuesday, October 21 at beginning of class

Matlab code are as separate files below.

Data

For Python you can use

  • Solution This is a dropbox folder that we have setup. It has both a pdf write up and scripts. Please feel free to explore them

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

Solutions

Lab #5, due Thursday, Oct 30 at beginning of class

Solutions

Lab #6, due Thursday, Nov. 6 at beginning of class

Python code:

Solution

Lab #7, due Tuesday, Nov. 25 at beginning of class

Lab #8, due Thursday, Dec. 4 at beginning of class

Python code:

  • boltz.py - python version of the above code with solution.

Solutions