Block Practical: Connectionist Models and Cognitive Processes
This is less of a blog post and more of a materials dump from an elective practical I taught to second year undergraduate students in the Experimental Psychology Department at the University of Oxford. I thoughtlessly deleted the webpage that contained them, assuming no student after 2 years would need them. How wrong I was! I received an email the other day from a Ph.D. student at a university on the other side of the world pretty much asking where these materials had disappeared to. This made me question my assumption nobody was looking at these materials. So to save myself and others from looking for them again, here they are for everybody.
This elective practical taught second year undergraduates to program in Python at a basic level and to understand the basics of artificial neural networks. They proved highly suitable as my students had not done much/any programming before and had not really heard of neural networks (things might have changed now, hype, etc).
To clarify, I do not teach this course any more and I will not be updating or using these materials. If you want to use them for your own teaching, they are CC BY 4.0, and I would super appreciate an email or tweet me if you use them.
1st Week: Introduction to Programming and Connectionist Networks
- Code: pyceptron.py
- Slides: Part 1: Intro to Programming, Part 2: Intro to Networks
- Exercises: Pyceptron
2nd Week: Going from Two Network Layers to Three
- Code: network_missing.py, network_hints.py, network.py
- Slides: Part 3: Feedfoward Networks
- Exercises: Backpropagation
3rd Week: Replicating a Model
- Code: network.py
- Patterns: tyler_patterns.csv
- Slides: Part 4: Replicating a Model
- Exercises: Replication of Tyler et al. (2000)
- Tyler, L. K., Moss, H. E., Durrant-Peatfield, M. R., & Levy, J. P. (2000). Conceptual structure and the structure of concepts: A distributed account of category-specific deficits. Brain and Language, 75(2), 195-231.
4th Week: Writing up Experimental Results
- Code: network.py, graph.py
- Example file for errors: errors1000.txt
- Slides: Part 5: Writing the Report
- Exercises: File Input/Output
- Learn Python the Hard Way
- How to Think Like a Computer Scientist: Learning with Python
- Think Python: How to Think Like a Computer Scientist
- Numpy Tutorial
- Matplotlib Examples
- A Primer on Scientific Programming with Python
- Scipy Lecture Notes
- The Glowing Python: This blog has various examples of interesting code to play with and give you ideas for your own projects.
- WildML: Recurrent Neural Networks Tutorial, Part 1 – Introduction to RNNs: This blog also has other Machine Learning tutorials.
- Machine Learning, by The Royal Society
- The Cognitive and Computational Neuroscience of Categorization, Novelty-Detection, and the Neural Representation of Similarity, by Mark Gluck
- Machine Learning, by Andrew Ng
- Neural Networks for Machine Learning, by Geoffrey Hinton
- Introduction to Neural Networks, by Sebastian Seung
How to install Python
This is a little tricky:
Install Python: download from here
Install matplotlib, numpy, and scipy using pip. Specifically you need to download the following from here:
This requires you to be in the Scripts folder of the Python27 installation. And to use the windows command prompt. For me this looks like:
C:\Python27\Scripts>pip install NAME_OF_WHEEL_FILE.whl
For all three of those you need to run a pip command like above.
Install PyGTK: download from here
To check that everything works, open network.py and see if it runs without any errors.
I finally managed to do this on my mac. Use Homebrew to install matplotlib, numpy, scipy, pygtk.
Use your favourite package manager to install matplotlib, numpy, scipy, pygtk.