joy of simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · joy of simulation...

72
Joy of Simulation For Fun ... and Profit! Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 1

Upload: vunga

Post on 05-Feb-2018

231 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Joy of Simulation

For Fun ... and Profit!Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 1

Page 2: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Who is person?

Vincent D. WarmerdamData Person @ GoDataDriven in Amsterdam

What we do?

Please bring out your laptops.

We are going to do an experiment in the beginning.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 2

Page 3: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Today

• randomness: what it is, what it isn't (5 min)

• explain sampling for modelling inference (1 min)

• better tactics for monopoly (5 min)

• sell lego minifigures/ebay (5 min)

• sampling as an optimisation tactic (5 min)

• outsourcing creativity (2 min)

• pokemon related subject (8 min)Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 3

Page 4: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

RandomnessBefore talking about what it is.

We should make sure what it is not.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 4

Page 5: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

What is not randomness?

Are you ready for an experiment? Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 5

Page 6: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

What is not randomness?Go to http://koaning.io/.

Click the blogpost named human entropy.

Await (or read) instructions.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 6

Page 7: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Human Entropy ...... is terrible! This is why we prefer to use a computer to help us think about probability. We could also use maths but often using a computer is just easier.

The goal of this talk is to convince you of this via some fun examples.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 7

Page 8: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Inference via SamplingBeing able to sample allows us to not have to resort to maths.

Sometimes we know the characteristics of a system but we'd like to know the likelihood of a certain event happening. Again we can use sampling instead of maths to do the inference for us.

The next slide contains a sampling task containing dice.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 8

Page 9: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Inference via Sampling

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 9

Page 10: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Inference via SamplingThis was the most basic example I could think of that drives the point home.

If you are interested in slightly more advanced approaches consider checking out PyMC3 or emcee.

I've also got a tutorial on a sampling algorithm for a timeseries task at my blog. It is a bit advanced but if you know scikit learn, you may learn a thing or two.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 10

Page 11: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Let's consider a fun example of this

Monopoly!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 11

Page 12: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopoly

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 12

Page 13: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopoly

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 13

Page 14: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopolytile name prob5 reading 0.23376915 pennsylvania 0.25584925 b&o railroad 0.27093035 short line 0.239452

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 14

Page 15: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopoly name color p e1 Mediterranean Avenue purple 0.0410 0.08192 Baltic Avenue purple 0.0424 0.16983 Oriental Avenue light_blue 0.0410 0.24584 Vermont Avenue light_blue 0.0417 0.25045 Connecticut Avenue light_blue 0.0415 0.33226 St. Charles Place pink 0.0410 0.40967 States Avenue pink 0.0434 0.43438 Virginia Avenue pink 0.0471 0.56539 Tennessee Avenue orange 0.0505 0.706610 St. James Place orange 0.0513 0.717911 New York Avenue orange 0.0480 0.768112 Kentucky Avenue red 0.0481 0.8664...

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 15

Page 16: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopoly

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 16

Page 17: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Monopoly

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 17

Page 18: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Let's consider something profitable

Lego Minifigures!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 18

Page 19: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego Minifigures

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 19

Page 20: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego MinifiguresAquired data for Simpsons Minifigures.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 20

Page 21: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego MinifiguresCleanup via sampling. • Grab 30 prices at random

• Calculate an average

• Repeat

This should give me an image of what the mean distribution of prices might look like.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 21

Page 22: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego Minifigures

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 22

Page 23: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego MinifiguresA minifigure costs about 3 euro a piece.

We can sell a set for 100 euro later.

How likely is it have a full set?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 23

Page 24: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Math Overflow to the Rescue?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 24

Page 25: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego Minifigures

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 25

Page 26: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Lego Minifigures

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 26

Page 27: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Step 3: Profit (... some day)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 27

Page 28: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Let's talk about general usecases...

Optimisation!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 28

Page 29: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Optimisation!Sometimes sampling can help with an optimisation problem! Let's take a simple example; finding the largest triangle in a 1x1 square.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 29

Page 30: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Let's start with randomrand_vals = np.random.rand(100000, 6)_ = plt.hist([shoelace(i) for i in rand_vals], 30)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 30

Page 31: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 31

Page 32: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 32

Page 33: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 33

Page 34: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Learning step

This Probabilistic approach allows us to learn many things from just sampling!

We've just shown , if we sample new coordinate points from this distribution, what does the new area histogram look like?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 34

Page 35: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Before

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 35

Page 36: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

After

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 36

Page 37: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Next steps

We can repeat the same idea until some form of convergence. Note that can be chosen in automatic fashions as well, ie.

.

The cool bonus with these algorithms is that we can use inference on our simulated data to learn more about the nature of our optimisation problem.

Genetic algorithms work in a very similar way!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 37

Page 38: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Next steps

If you're interested in learning more about this you'll want to see my collegue's talk on this topic.

He'll talk more in detail about these sampling methods for optimisation. In this specific talk he adresses how to win at the boardgame Risk.

"How to Conquer the World"Thursday (12:00, PyCharm room)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 38

Page 39: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Things that I am most interested in.

Generative Methods...

(... to outsource Creativity)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 39

Page 40: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativitySofar distributions have been rather static. In this next bit I'll introduce a more markovian way of thinking about randomness.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 40

Page 41: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityDoes anybody understand this joke?

my linkedin profile

R, python, javascript, shiny, dplyr, purrr, ditto, ggplot, d3, canvas, spark, sawk, pyspark, sparklyR, lodash, lazy, bootstrap, jupyter, vulpix, git, flask, numpy, pandas, feebas, scikit, pgm, bayes, h2o.ai, sparkling-water, tensorflow, keras, onyx, ekans, hadoop, scala, unity, metapod, gc, c#/c++, krebase, neo4j, hadoop.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 41

Page 42: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityRecruiters cannot distringuish a pokemon name vs. a name of a technology.

I figured making a python library that can generate pokemon names might be fun (grabble = tech names as a service).

...

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 42

Page 43: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityRecruiters cannot distringuish a pokemon name vs. a name of a technology.

I figured making a python library that can generate pokemon names might be fun (grabble = tech names as a service).

... speaking of pokemon as tech names.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 43

Page 44: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 44

Page 45: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityRecruiters cannot distringuish a pokemon name vs. a name of a technology.

I figured making a python library that can generate pokemon names might be fun (grabble = tech names as a service).

Never wrote a library before and the problem seemed interesting enough. I will most likely learn from doing this.

It will probably result in a twitter bot some day.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 45

Page 46: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Short Term PlanThe whole point of grabble, is to

come up with a better name.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 46

Page 47: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityThe general problem of this hobby project involves generating believable sequences of tokens.

Things like:• pokemon names

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 47

Page 48: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityThe general problem of this hobby project involves generating believable sequences of tokens.

Things like:• pokemon names

• red hot chilli pepper lyrics

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 48

Page 49: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityThe general problem of this hobby project involves generating believable sequences of tokens.

Things like:• pokemon names

• red hot chilli pepper lyrics

• ikea furniture names

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 49

Page 50: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityThe general problem of this hobby project involves generating believable sequences of tokens.

Things like:• pokemon names

• red hot chilli pepper lyrics

• ikea furniture names

• notes on a piano Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 50

Page 51: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativitySimplest model:

For every pair of tokens, keep track how often they occur together. Once you have a start token, you now have a bag of words with probabilities to sample from.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 51

Page 52: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityMore complex model:

Do the same thing but for three tokens.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 52

Page 53: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityModels that I'm considering:

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 53

Page 54: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativitySome pokemon results:

lydokeenwqoolryryspooleutcalayoutailolmaelttyp

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 54

Page 55: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativitySome red hot chilli pepper results:Can you believe. Hold me please.By the way I wonder what the wave meant.White heat is screaming in the nearest bin.When I was fortunate I know you must be fat this year.And eat the sun and a Bottom Dollar.Fox hole love Pie in your house now let me spin Feather light but you cant move this

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 55

Page 56: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativitySome ikea results:

anapafrodokpasigripelatrankvisgsooyirbsilosseln

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 56

Page 57: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityAlas, I've only shown you the nice bits.

Most of them are not good.

alrb eaota lavi aepmajkge oarterv lygea aavractpfi ilosseln mmbor adittgk mlale glg stegnaeogae aak niaey lgaonhrjke eaalb btomd raiunlrs jrta nntt dayrsiht idll eaeann ileaeoredaate dsfkvkr rprnh rbkuooerngj emee aiaaaa ioapu

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 57

Page 58: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; make ensembles.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 58

Page 59: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; combine lexicons via different models.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 59

Page 60: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; add transcribers.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 60

Page 61: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityAnother solution; add judges.

After sampling 100 samples. Maybe have another model look at the results and pick the top 10.Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 61

Page 62: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; factor graph models?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 62

Page 63: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; heuristics?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 63

Page 64: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityOne solution; deep models?

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 64

Page 65: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityDeep models have issues.

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 65

Page 66: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityI will focus on the following three algorithm domains:

• probibalistic graphical approaches

• heuristic approaches

• deep neural network approaches

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 66

Page 67: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Outsourcing CreativityThere's similar work being done in this field for images.

Source: openai.Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 67

Page 68: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Rough API Planlx1 = gb.Lexicon(filepath/iterable)lx2 = gb.Lexicon(filepath/iterable)

mod1 = gb.Model.OneWayMarkov(n = 2, smoothing = 0.001).fit(lx1)mod2 = gb.Model.TwoWayMarkov(n = 3)\ .translate(gb.Transcribe.Vowel).fit(lx1)mod3 = gb.Model.FactorGraph().fit(lx2)

mod1.generate(20)mod2.generate(20)

ens = gb.Model.Ensemble([mod1, mod2])ens.generate(100).sort(mod3.judge)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 68

Page 69: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Dreamsmod4 = mod1.addTransducer(gb.Vowel).fit(lx1)

ens = gb.Model.Ensemble([mod1, mod2])ens.finish(['*', '*', '*', 'B', 'A', 'S', 'E'], n = 100)ens.finish(['*', '*', '*', 'D', 'A', 'T', 'A'], n = 100)ens.finish(['H', 'A', '*', '*', '*', 'P', '*'], n = 100)

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 69

Page 70: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Creativity? Come see blender!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 70

Page 71: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

ConclusionSampling can be a whole lot of fun and sometimes even profitable. Getting started is easy and you might be suprised how often it can help you out.

Python is an amazing language for this usecase too.

Think about API from user first. Optimize Joy!

Shoutout to numpy, cytoolz and generators. Helpful!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 71

Page 72: Joy of Simulation - koaning.iokoaning.io/theme/notebooks/simulation_2016.pdf · Joy of Simulation For Fun ... hadoop, scala, unity, metapod, ... krebase, neo4j, hadoop. Vincent D

Thanks for Listening!

Vincent D. Warmerdam - GoDataDriven - koaning.io - @fishnets88 72