Revision 444e5a3daf141740f8beedb68560a6eaf9c0fd3f (click the page title to view the current version)

Neural Networks



Exercise 1. Basic tutorial.

I have added a couple of exercises to the official PyTorch Quickstart.

  • Download and open the (augmented) tutorial.
  • Please reflect upon and discuss the questions.

Exercise 3. Regression.

One in-house project is to classify images of remote galaxies, which are often distorted due to the gravity of dark matter. This effect is known as gravitational lensing.

A sample dataset can be found at github. This directory contains

  • A data file, sphere-pm.csv
  • 10000 images of distorted galaxies
  • A python file defining a subclass of Dataset to manage these data

The CSV file has the form


The interesting columns are the filename which points to the input image, and the four output variables \(x\), \(y\), einsteinR, and \(\sigma\). The other columns are associated with more advanced problem instances and should be ignored.

  1. Study the Dataset class How is the dataset managed?
  2. Use this class to test if you can train a network to determine the four outputs for an image.

Exercise 4. Managing Data.

Doing a tutorial is good, but it is little use if you you can only use the sample data. The goal of this exercise is to learn to manage other datasets.

Please be aware that deep learning is usually extremely compute intensive, and you can easily run into a problem which takes days to compute. The immediate solution to this is to

Download another dataset, for instance from this collection and try to solve the classification problem.