Applying Deep Learning

Style transfer

  • Networks learn painting styles and can apply it to any other image
  • https://github.com/lengstrom/fast-style-transfer

DeepTraffic

  • Use DL to navigate through traffic efficently
  • MIT simulation of highway traffic
  • Single car run by trainable, neural network.
  • Task: Drive as fast as possible, learns by trial and error.
  • Takes input, process through hidden layer, outputs
    • Input = state
      • Lane
      • Speed
      • Cars around it
    • State is updated at each time step
    • Hidden layers find patterns and learn from them. More will be revealed.
    • Output = How fast car is driving
  • This is reinforcement learning. Neural network experiments with trial and error and favors any decision that improves car’s speed.
  • https://selfdrivingcars.mit.edu/deeptraffic/

Flappy Bird

  • https://github.com/yenchenlin/DeepLearningFlappyBird.git
  • Another example of reinforcement learning.
  • AI can learn to play FlabbyBird with no knowledge of its mechanics.
  • Example of console output while AI plays FB
TIMESTEP 5880 / STATE observe / EPSILON 0.0001 / ACTION 0 / REWARD 0.1 / Q_MAX 1.266485e+01
TIMESTEP 5881 / STATE observe / EPSILON 0.0001 / ACTION 1 / REWARD 0.1 / Q_MAX 1.278625e+01
  • Question: Is there a FlappyBird API the neural net is tapped into? Or is it actually assessing the visuals?
    • Answer: … input is raw pixels and … output is a value function estimating future rewards.
  • https://www.manning.com/books/grokking-deep-learning
  • http://neuralnetworksanddeeplearning.com/
  • http://www.deeplearningbook.org/

Tooling

Anaconda

  • Anaconda is a python env and package manager aimed at supporting data science projects.
  • conda distribution comes with a ton of packages. miniconda is a lighter alternative.
  • Does not exclusively manage python packages.
  • Packages, including python version, are scoped to conda environment
  • Share conda envs by exporting env yaml
    • Export conda env export > environment.yaml
    • Import conda env create -f environment.yaml
  • Include an env.yaml in public repos, or use a pip freeze file for those without anaconda

Jupyter Notebooks

  • Web app to store code, videos, data, notes
  • Method to share data based projects growing in popularity
  • Inspired by Donald Knuth’s Literate Programming

    The practitioner of literate programming can be regarded as an essayist, whose main concern is with exposition and excellence of style. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

  • nb_conda lets you manage conda environments from Jupyter
  • TIL you can highlight math in markdown files w/ $ offsets: $2 + 2 = 4$ Even prettier, do multiline w/ $$:
  • Break command out of notebook code blocks with keywords prefaced w/ % or %%
  • For example, %timeit will run metrics on a function, %matplotlib can be used to embed a visualization and %pdb turns on debug mode
  • Notebooks are just JSON w/ an .ipynb extension.
    • Makes it easy to convert them to other formats
    • nbconvert is the utility to do it
  • Create slideshows out of notebooks, too