Final Report

This is the report about my GSOC project done during the summer of 2018. My project was to set up interactive machine learning demos of Flux.jl on a webpage. This is done in 3 steps:

  1. Create a trained Flux model
  2. Convert Flux model into Javascript using FluxJS.jl
  3. Create an interface and load the model on the webpage
The models implemented are put up on the Flux website.

Web Demos for Flux

Go demo

Go is an Ancient Chinese game with a huge search space. A tree search on all the possible moves of this game is not feasible (complexity). AlphaGo is an algorithm that achieves a good performance in this game through a guided tree search. The tree search is guided by a neural net which predicts the value of the current state and the probabilities of transitioning to other states.

Code

Cartpole demo

Cartpole is a game where a pole is balanced on a cart by applying forces from the left and right. The model for this demo receives the x position and velocity of the cart and the angle and angular velocity of the pole as inputs, to predict the next direction to move in. The game is over when the pole is beyond a certain angle or when the cart touches the end of the screen. The model is a Deep Q-Network that provides the value of each action given the state.

Code

MNIST demo

The MNIST data is used to train a model to recognise handwritten digits. The model uses convolutional layers, maxpool and a dense layer. It has an accuracy of 96%.

Code

CPPN demo

The header of Flux website is animated using patterns produced by a neural network consisting of Dense layers with tanh functions. The x and y coordinates of each point on the pattern is cast into a range of -0.5 to 0.5. The pattern is produced by querying a neural network to get the opacity at each pixel. The input for this query is (x, y, r, z1, z2) where r = sqrt(x^2 + y^2), and [z1, z2] form a latent vector for the neural network. An animation is produced by varying z bit by bit.

Code

Fast Style Transfer demo

Style Transfer is the method of transferring the style of one image (the style image) to another ( the content image) to produce a stylised image (initialised to noise). This is done by passing the images through a few layers of a pre-trained network like VGG to produce representations of the three images and then minimising the error given by the style loss function and the content loss function. This process takes a while, hence an Image Transformation Network (ITN) is developed to transfer the style from a specific style image to any content image. The website showcases three ITNs.

Code

Pong

The model used in this demo can play the atari game pong which is based on the classic game ping-pong. The model uses a Dueling Deep Q-Network. The difference from a DQN is that the updates are made on a copy of the model. The model is set to the updated model only after a large number of steps.

Code

FluxJS Features


The End?

I would like to thank my mentors @Mike Innes and @Jane Herriman, other gsoc students, @Tejan Karmali and @Avik Pal, and the wonderful julia community for the support and help. Special thanks to The Julia Project and NumFocus for facilitating my travel and giving me a chance to present a poster at Juliacon 2018. GSoC is ending, but I hope this is just the beginning :)