Slide 1

Slide 1 text

(defn talk [m] (-> m (assoc :title "Infinite State Machine") (assoc :speaker "Eric Weinstein") (assoc :conf "Clojure/conj") (assoc :city "Baltimore, MD, USA") (assoc :date "13 October 2017")))

Slide 2

Slide 2 text

Part 0: Hello!

Slide 3

Slide 3 text

About Me (def eric-weinstein {:employer "Fox Networks Group" :github "ericqweinstein" :twitter "ericqweinstein" :website "ericweinste.in"}) 30% off with CLOJURECONJ30! ->>

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Agenda • Poems about the machine • Poems with the machine • Poems by the machine (Markov Chain + RNN) • Questions (if we have time)

Slide 6

Slide 6 text

Part 1: About

Slide 7

Slide 7 text

Poem About the Machine • Isn’t this a programming conference? • Eliot and the objective correlative • This poem is called “Memory Leak”

Slide 8

Slide 8 text

The machine stays up all night writing poems smoking some it spawns a billion threads of execution little tales it tells itself in tale zero it sails from island to island in an archipelago linked

Slide 9

Slide 9 text

by green arrows of algae In tale one it is a blue fork of lightning whose ends reach into the head of every child in the neighborhood and install imaginary friends a sheep a robot

Slide 10

Slide 10 text

made of bottle caps The machine constructs these artificial histories but never deletes one One memory runs into the next bioluminescent algae fill the neighborhood pools a robot sails for the New World

Slide 11

Slide 11 text

in a stiff breeze The humans wake to find one billion machine poems overflowing the hard drive the last one reading I would grow human teeth of my own and dissolve them I would send signals directly into your heart

Slide 12

Slide 12 text

Part 2: With

Slide 13

Slide 13 text

Poems && Programs • Many parallels between code and poems (not just correct syntax, but style, idiom, line breaks, &c) • “REMCy.clj” is an example of an executable poem

Slide 14

Slide 14 text

;; REMCy.clj ;; ;; Give me your hands, if we be friends. ;; -- Robin Goodfellow (def og; the window "To withstand the presence of ghosts." (let [us "Know that they all lived"; & the-window "is open"] [us, the-window])) (defn f[or-me] (let [the-ending-be " happily ever after"] [the-ending-be, or-me])) (def o "Rest now, the ending is written on the tallest tree.") (let [me og;re able " "; & open hands-inef (f able)] o (str;ange! We are haunted. (first me) (first (f able)))); &

Slide 15

Slide 15 text

Part 3: By

Slide 16

Slide 16 text

(Poem.) • Training corpuses (Keats, Shakespeare) • Markov chain • RNN (Recurrent Neural Network)

Slide 17

Slide 17 text

Corpus • Poems by John Keats (1817) • 2_076 lines, 13_660 words, 79_409 characters

Slide 18

Slide 18 text

Markov Chain • A Markov chain is a stochastic, “memoryless” process • The Markov property: we can get to our next state only knowing our current state • (You can sort of cheat by baking arbitrary history into the current state)

Slide 19

Slide 19 text

Prose Poem by A. Machine Yet this happy burthens Eric. I echo back each sting Thrown by thy vigils keep 'Mongst boughs pavillion'd, where sheeted lightning plays; Or, on a train Of whitest arms in these joys That through half veil'd face of his latest breath, While from Armida's bowers, And, warrior, it e'er will keep A fragile dew-drop on the room like something from his trappings glow Of this wonder of Despair, Strive for lo! I feel their soft "Lydian airs," And fresh sward beneath it, (For knightly casque are thirsty every hour. And can make "a sun-shine in throngs before him away, Than the goodliest view a Poet, sure shall be alone. Yet these scribblings might call my spirit shroud, Sweet too upheld the supreme of May seem a flower, into a gentle doings: They should not the eastern dimness, And his star-cheering voice sweetly they occasion; 'tis I marvel much more beautiful, more pleasing, a new sun-rise.

Slide 20

Slide 20 text

RNN • Neural network with memory (unlike a Markov chain) • DL4J: https://deeplearning4j.org/ • Shakespeare: 124_787 lines, 904_061 words, 5_589_889 characters

Slide 21

Slide 21 text

Image credit: https://leonardoaraujosantos.gitbooks.io/artificial-inteligence/ content/image_folder_6/recurrent.jpg

Slide 22

Slide 22 text

Humans Like Chocolate, Right? Credit: http://lewisandquark.tumblr.com/post/140508739392/the-neural-network-has- weird-ideas-about-what

Slide 23

Slide 23 text

Humans Like Chocolate, Right? Credit: http://lewisandquark.tumblr.com/post/140508739392/the-neural-network-has- weird-ideas-about-what

Slide 24

Slide 24 text

To Serve (Hu)man(s) Credit: http://lewisandquark.tumblr.com/post/140508739392/the-neural-network-has- weird-ideas-about-what

Slide 25

Slide 25 text

To Serve (Hu)man(s) Credit: http://lewisandquark.tumblr.com/post/140508739392/the-neural-network-has- weird-ideas-about-what

Slide 26

Slide 26 text

To Serve (Hu)man(s) • ¼ cup white seeds • 1 cup mixture • 1 teaspoon juice • 1 chunks • ¼ lb fresh surface • ¼ teaspoon brown leaves • ½ cup with no noodles • 1 round meat in bowl Credit: https://www.dailydot.com/unclick/neural-network-recipe-generator/

Slide 27

Slide 27 text

I Dub Thee: Stargoon Credit: http://lewisandquark.tumblr.com/post/161854386267/neural-networks-can-name- guinea-pigs

Slide 28

Slide 28 text

I Dub Thee: Stargoon Credit: http://lewisandquark.tumblr.com/post/161854386267/neural-networks-can-name- guinea-pigs

Slide 29

Slide 29 text

I Dub Thee: Stargoon Credit: http://lewisandquark.tumblr.com/post/161854386267/neural-networks-can-name- guinea-pigs

Slide 30

Slide 30 text

The Unreasonable Effectiveness of Recurrent Neural Networks • Blog post by Andrej Karpathy (May 2015) • “There’s something magical about Recurrent Neural Networks (RNNs).” • http://karpathy.github.io/2015/05/21/rnn- effectiveness/ • https://github.com/karpathy/char-rnn (used to generate the recipes and guinea pig names)

Slide 31

Slide 31 text

Show Me the Code

Slide 32

Slide 32 text

10 Mini Batches loif yeund, wochesther anftaome nooceiniIs beyloalt, thelveokk theouossir thochenplad my ard, aty lotheneud, somenh. EEPeCND. Ons, id theor oudoly Notfof aolllyLeagaoner lirchin, ithen, pay sudthas eomee sfolbfetf dotheut, Af thowrne shame, houd palid. EOTMOS.OOtir, hol mesoalgteus ou

Slide 33

Slide 33 text

50 Mini Batches Ast beanbly earther, That is fay that hath a begwer. And, the face! Exeunt Frods. Let lingher me! Lothfy here'nst with honours, by thee. GLOUCESTER. Henply, cancut these orwerd. Plence was he likesess puince, Det, woulst of brother. He will sech the exate,

Slide 34

Slide 34 text

160 Mini Batches SILVIA. The sleep- Villain; so shouty I desire Like his courtesy'r's thrice of Curst; And four lady, doth be hone'ring-broke of this, And so who ley subdue. My comforts. QUEEN ELIZABETH. Where's Bugidde

Slide 35

Slide 35 text

Image credit: https://bukk.it/notbad.gif

Slide 36

Slide 36 text

TL;DPA • Poems are emotive programs and programs are poems for the machine • Poems can be programs (and vice-versa!) • Machines can write poems (via Markov chains, RNNs, and more) • The future: Cortex (thanks, Joyce Xu!)

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Questions? (def eric-weinstein {:employer "Fox Networks Group" :github "ericqweinstein" :twitter "ericqweinstein" :website "ericweinste.in"}) 30% off with CLOJURECONJ30! ->>