Homework 4

Autodiff and Style Transfer

Due Dates

Due Sunday, April 18 at 11:59pm Pittsburgh time

Introduction

This assignment involves understanding some of the basics of deep learning frameworks.

This assignment consists of two major parts. You will first implement a multi-layer perceptron to perform entity classifiation without using any deep learning framework. You will then implement a style transfer application using the popular TensorFlow framework.

Logistics

As with the previous homeworks, we provide the code template for this assignment in a Jupyter notebook. What you need to do is to follow the instructions in the notebook and implement the missing parts marked with <FILL IN> or YOUR CODE HERE. Most of the <FILL IN> or YOUR CODE HERE sections can be implemented in just one or two lines of code.

Getting lab files

There are two parts to this homework. Each part has its own notebook file and should be submitted separately.

Since we are not using Spark in this homework, you should import your notebook into Google Colaboratory instead of Databricks.

Preparing for submission

We provide several public tests via assert in the notebook. You may want to pass all those tests before submitting your homework. Also be sure to fill out the manually graded questions in the cells that we provide you.

In order to enable auto-grading, please do not change any function signatures (e.g., function name, parameters, etc) or delete any cells. If you do delete any of the provided cells (even if you re-add them), the autograder will fail to grade your homework. If you do this, you will need to re-download the empty ‘assignment notebook.ipynb’ file and fill in your answers again and resubmit.

Submission

  1. Export your solution notebook as a IPython notebook file on Databricks via File -> Export -> IPython Notebook
  2. Submit your solution via Gradescope (Please don’t rename your notebook file).

Part 1: Autodiff

In this part, you will implement a multi-layer perceptron to perform entity classification (i.e., predicting the category label of a DBPedia entity based on its title) without using any deep learning frameworks. The auto-differentiation will be handled by the provided code. You will implement:

  • The Forward / Backward Pass
  • Optimization
  • The Model Architecture and Initialization
  • Training and Validation

Part 2: Style Transfer

In this part, you will implement the style transfer application described in Leon A. Gatys et al’s paper, A Neural Algorithm of Artistic Style using the TensorFlow framework. In particular, you will:

  • Visualize the data and expected outputs
  • Process the data
  • Create the model
  • Define the loss function
  • Optimize for the loss function and evaluation

    See the notebook for detailed descriptions and instructions of each question.