Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Do Androids Dream of Electronic Dance Music?

Do Androids Dream of Electronic Dance Music?

Slides for my RubyKaigi 2017 talk on machine learning + music, co-presented with the inimitable Julian Cheal!

Eric Weinstein

September 18, 2017
Tweet

More Decks by Eric Weinstein

Other Decks in Technology

Transcript

  1. Do Androids Dream of
    Electronic Dance Music?
    Julian Cheal and Eric Weinstein
    # Ruby Kaigi 2017
    # Hiroshima, Japan
    # 18 September 2017

    View Slide

  2. Do Androids What now?

    View Slide

  3. Part 0: Hello! こんにちは!

    View Slide

  4. Who Are We?

    View Slide

  5. Julian Cheal
    Rubyist
    RedHat

    View Slide

  6. Bath

    View Slide

  7. View Slide

  8. View Slide

  9. About Eric
    eric_weinstein = { # エリック
    employer: 'Fox Networks Group',
    github: 'ericqweinstein',
    twitter: 'ericqweinstein',
    website: 'ericweinste.in'
    }
    30% off with KAIGI30!

    View Slide

  10. Agenda
    • Introduction to machine learning
    • Neural networks, RNNs, and LSTM RNNs
    • Midi
    • Demo! Synths!?
    • Questions?

    View Slide

  11. Part 1: Machine Learning

    View Slide

  12. bit.ly/EricsMLTalk

    View Slide

  13. What Is It?
    • Machine learning is generalization
    • Supervised learning is generalizing from

    labeled data to unlabeled data

    View Slide

  14. Supervised Learning
    • Classification or regression
    • Learning patterns from labeled data, then
    generalizing to unlabeled data

    View Slide

  15. Part 2: Neural Networks

    View Slide

  16. • An artificial neural network is a machine learning
    model that mimics the structure and function of a
    biological brain
    • In our case, we’re interested in a particular kind
    of recurrent neural network:

    LSTM (long/short-term memory) network
    What Is It?

    View Slide

  17. Image credit: https://github.com/cdipaolo/goml/tree/master/perceptron

    View Slide

  18. Image credit: https://en.wikipedia.org/wiki/Artificial_neural_network

    View Slide

  19. Image credit: https://leonardoaraujosantos.gitbooks.io/artificial-
    inteligence/content/recurrent_neural_networks.html

    View Slide

  20. Part 3: Midi

    View Slide

  21. bit.ly/JuliansMusicTalk

    View Slide

  22. What is Midi?
    Dave Smith
    “Father of Midi”
    Midi invented in 1983

    View Slide

  23. Midi Note Data

    View Slide

  24. Midi Note Data

    View Slide

  25. Find some Data

    View Slide

  26. deadmau5 - Chimaera
    https://splice.com/sounds/
    splice/deadmau5-chimaera

    View Slide

  27. Convert the Data
    Midi TFRecord

    View Slide

  28. Convert the Data

    View Slide

  29. Moar Data

    View Slide

  30. Bring your Own Data

    View Slide

  31. View Slide

  32. Show me the Code

    View Slide

  33. Part 4: Dance Party

    View Slide

  34. Overview
    • The technology (Python, Ruby, Tensorflow, Magenta)
    • The architecture of our neural network
    • How did training go?
    • Demo time/dance party!

    View Slide

  35. We need More Ruby!
    • Python 93.4%
    • Ruby 4.8%
    • Shell 1.8%
    WTF!
    This is Ruby Kaigi

    View Slide

  36. View Slide

  37. Summary
    • Machine learning is generalization
    • Neural networks are machine learning models based on
    biological brains
    • RNNs are a kind of NN with “loop”; feedback allows
    modeling for text prediction, music generation, and
    more
    • We can do this all with Ruby, we just need the library
    support!

    View Slide

  38. 3.times { puts 'ありがとう!' }

    View Slide

  39. Questions?
    @ericqweinstein
    @juliancheal

    View Slide