mark my words

athiest father preying for a secular future

LSTM Cells

I haven’t quite got to LSTM in my book yet, but they were talkinga bout them in the TensorFlow Dev Summit.
I found this neato resource

The LSTM’s really remind me of logic gates.  Especially flip-flop, where they put together some NOR gates to make memory.

Using a series of LSTM’s might be good for parsing the entire bidding auction.  The bidding is kind of like a sentence.

February 17, 2017 AI Bridge Project

TensorFlow Summit

This tool is pretty neat.  It lets you visualize your data.

Data Map

It would be neat if I could map different bridge hands into 3D space for display

February 16, 2017 AI Bridge Project

Neat Images

I thought this article had some neat images!

http://www.wired.co.uk/gallery/machine-learning-graphcore-pictures-inside-ai

 

 

AI Bridge Project

TenserFlow 1.0

Looks like there is a new release of TensorFlow.  I see there is an 8 hour video!  Looks like good watching, perhaps this weekend?

https://events.withgoogle.com/tensorflow-dev-summit/watch-the-videos/#content

AI Bridge Project

Well I guess someone beat me to the punch

I found an amazing journal entry explaining exactly what I wanted to do!  They even did a better job than I was thinking.

https://arxiv.org/abs/1607.03290

They got around the ‘double dummy’ by dealing 5 hands.  A pretty good idea.  They also used gradient decent based on the score.  I wonder if they are calculating double dummy throughout their learning loop.

A couple of things that could be added, they don’t seem to take into consideration opponent’s bidding nor vulnerability.  They also didn’t partition their DNN based on suits, which I think would give the model a big head start.

But really cool work.

 

AI Bridge Project

Deep Learning

This Deep learning book is turning out to be very technical.  But it is terrific!  It explains in technical detail exactly what each function does and the reasoning behind it.

My purpose of learning this deep learning is the develop a bridge bidding system using raw data.  Essentially, don’t worry about human conventions at all.  Also, don’t tell the computer it has a partner, let it just find the best score based off the information it has.

This insight has allowed me to think of other problems.  Eg, When solving double dummy hands, the max number of tricks you make, might be different than the goal of number of tricks you need.  Thankfully the deal program can tell you how many tricks you can take via a greedy line, and how many tricks you can take via a conservative line.

I think the ideas of bidding conventions might be a bit complex.  It might be best to have a computer actually bid what they think they can make.  I obviously can’t create machine learning for each bidding sequence.  So I think the computer should only take the last bid into consideration.  What happens if the opponents are playing a conventional bid, then it would be stupid to try to infer anything other than that could be the last bid they make!  I imagine it will emerge that all the computer agents have a huge advantage to bid what they actually have.  Both for descriptive reasons and for pre-emptive reasons.

A shortcut I could use is once I have a deal, do learning with each hand.  But this might really bias the data so I think I won’t do that. (Eg. 1 deal = 4 learning iterations)

Besides the book talking about softmax functions,which I think I can use to assign a probability of making each contract times the ‘expected value’, the scored reward of actually making the contract.

The model that seems to be pretty universal is a DNN with linear regression on the inputs, a convolution network on each suit, and a couple of relu layers.  Then a softmax expected value.  It would be neat to use gradient descent on the calculated score of the different bids.  But I’ll likely just use the default L2.

So that is my best beginner approach.

February 14, 2017 AI Bridge Project

Next on the list

A neat primer!

https://cloud.google.com/blog/big-data/2017/01/learn-tensorflow-and-deep-learning-without-a-phd

 

 

February 3, 2017 AI Bridge Project

First bidding Tensorflow

Success!

Success!

So, I gave my neural network 2 hands, the first one it says I should pass and the second I should bid 18.
ha!

What is all that red stuff? I guess the syntax in the example is depreciated. I’ll have to see if I can fix that.

February 1, 2017 AI Bridge Project

tf.contrib.learn

So it looks like Tensor flow has a highlevel API tf.contrib.learn which should be easier than the example I looked at yesterday.

It has a training dataset using IRIS (the flower), whereby data is imported via CSV file.  So I’ve formatted a few CSV files, and I’ll see if I can get my first run through.

I’ve formatted them the same as the IRIS data:

 

120 4 setosa versicolor virginica
6.4 2.8 5.6 2.2 2
5 2.3 3.3 1 1
4.9 2.5 4.5 1.7 2
4.9 3.1 1.5 0.1 0
5.7 3.8 1.7 0.3 0
4.4 3.2 1.3 0.2 0
5.4 3.4 1.5 0.4 0
6.9 3.1 5.1 2.3 2

It looks like 120 cause its got 120 records, 4 because there are 4 datapoints and then 3 because of the output of three different types of flower.

My data looks like this:

200,52,pass,1clubs,2clubs,3clubs,4clubs,5clubs,6clubs,7clubs,1diamonds,2diamonds,

3diamonds,4diamonds,5diamonds,6diamonds,7diamonds,1hearts,2hearts,3hearts,4heart

s,5hearts,6hearts,7hearts,1spades,2spades,3spades,4spades,5spades,6spades,7spade

s,1notrump,2notrump,3notrump,4notrump,5notrump,6notrump,7notrump

0,1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,8

1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,1,0,23

The 8 and the 23 were the highest scoring contracts given that hand for North. (1 diamond and 2spades)

Then I’ll call the sample python script and alter the querry data to see what it things I should make for a contract.

new_samples = np.array(

[[0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0], [0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0]], dtype=float)

AI Bridge Project

Podcast

Last night I listened to this podcast

https://twimlai.com/twiml-talk-8-diogo-almeida-deep-learning-modular-theory-inflexible-practice/

It was a real eye opener how much I have to learn!

AI Bridge Project