Warning: Declaration of action_plugin_tablewidth::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /s/bach/b/class/cs545/public_html/fall15/lib/plugins/tablewidth/action.php on line 93

Warning: Declaration of syntax_plugin_mathjax_protecttex::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /s/bach/b/class/cs545/public_html/fall15/lib/plugins/mathjax/syntax/protecttex.php on line 15
assignments:assignment4

Table of Contents

Assignment 4: Neural networks

Due: October 30th at 11pm

Part 1: Activation functions

In this question we will explore the relationship between the tanh and logistic sigmoid as activation functions. Recall that $\sigma(x) = \frac{1}{1 + \exp(-x)}$ and $\tanh (x) = \frac{\exp(x) -\exp(-x)}{\exp(x) + \exp(-x)}$. Show that:

  1. $\sigma(-x) = 1 - \sigma(x)$
  2. $\tanh(x) = 2\sigma(2x) - 1$

Now for the interesting part: Given a network that uses tanh as the activation, show how to obtain a network that computes the same function with logistic sigmoid as the activation function.

Part 2: Multi-layer perceptrons

In the first few slides about neural networks (also section 7.1 in chapter e-7) we discussed the expressive power of multi-layer perceptrons (with a “sign” activation function). Describe in detail a multi-layer perceptron that implements the following decision boundary:

Part 3: Exploring neural networks for digit classification

In this part of the assignment you will predict 8x8 handwritten digits. Loading the data will be easy, since scikit-learn provides an interface for this dataset that loads it into a usable format (there is an example of usage here). Your task for this part is to explore various aspects of multi-layer neural networks using this dataset. For simplicity, use 25 percent of the data for evaluating network performance, and the rest reserve for training. Normalize the data by dividing the features by the maximum value, which will normalize them to the range [0,1] (since the minimum is 0). As a basis for your implementation use the neural network code I showed in class.

Here's what you need to do:

The code that was provided does not really have a bias for all but the first layer. For 5 extra points, modify the code so that it correctly uses a bias for all layers.

Submission

Submit the pdf of your report via Canvas and associated code. Python code can be displayed in your report if it is succinct (not more than a page or two at the most). The latex sample document shows how to display Python code in a latex document. Code needs to be there so we can make sure that you implemented the algorithms and data analysis methodology correctly. Canvas allows you to submit multiple files for an assignment, so DO NOT submit an archive file (tar, zip, etc). Canvas will only allow you to submit pdfs (.pdf extension) or python code (.py extension). For this assignment there is a strict 8 page limit (not including references and code that is provided as an appendix). We will take off points for reports that go over the page limit. In addition to the code snippets that you include in your report, make sure you provide complete code from which we can see exactly how your results were generated.

Grading

A few general guidelines for this and future assignments in the course:

Grading sheet for assignment 4

Part 1:  15 points.
( 5 points):  Properties of the logistic function and tanh
(10 points):  Relationship between weights of equivalent networks

Part 2:  10 points.

Part 3:  65 points.
(20 points):  Exploration of a network with a single hidden layer
(20 points):  Exploration of a network with two hidden layers
(15 points):  How to add weight decay
(10 points):  Linear activation function

Report structure, grammar and spelling:  10 points
(10 points):  Heading and subheading structure easy to follow and clearly divides report into logical sections.  
              Code, math, figure captions, and all other aspects of the report are well-written and formatted.
              Grammar, spelling, and punctuation.  Answers are clear and to the point.