►
Description
Attempts to teach NuPIC to play a card game. Includes some examples of encoding the state of the game.
http://nupic2015spring.challengepost.com/submissions/37832-nupic-plays-poker
A
So
my
name
is
Sergey
and
I
want,
since
the
first
hackathon
I
wanted
to
have
a
new
pic
play
a
game
and
I
found
one
that
I
think
works
fairly
well,
I've
know
if
anyone
is
familiar
with
open
face,
Chinese
poker.
Just
so
I
can
explain
how
new
pic
works
with
it.
I
have
to
explain
the
rules,
so
you
have.
Every
player
has
three
hands.
A
The
first
has
three
cards,
the
other
two
have
five
cards
and
by
drawing
cards
from
the
deck
you
have
to
get
combinations
and
then
the
hands
are
scored
so
each
hand
is
scored,
like
poker
like
a
poker
hand
versus
the
respective
hand
of
your
opponent,
and
your
bottom
hand
has
to
be
strong
stronger
than
your
middle
and
then
the
middle
hand
has
to
be
stronger
than
your
top
hand.
Moreover,
for
every
kind
of
combination
that
you
can
get,
you
get
a
certain
amount
of
points.
A
The
reason
why
I
thought
that
this
would
work
all
the
new
pic
is
that
the
game
is
a
fairly
simple
sequence.
Five
steps
per
game
and
I
thought
that
this
would
be
highly
generalizable,
so
it
is
pretty
computational
complex
I
that
it's
not
like
perfectly
solvable
so
I
figured
I
would
make
an
encoder
4
cards
where
you
encode
your
engine
code.
A
You
can
call
the
type
of
the
card
you
held
the
rank,
and
then
you
have
26
variables
for
every
position
on
the
field,
whether
there's
a
card
with
certain
characteristics
and
then
I,
basically
coded
the
game
and
rented
to
randomly
assign
moves
and
see
what
what
new
pic
would
learn-
and
this
is
what
google
shows
for
spectacular
failure,
obviously
didn't
learn
anything
so
I
started
thinking
about.
Why
look
at
these
two
hands
for
that
encoder
they're,
completely
different!
A
No
cards
are
shared,
however,
for
a
player
looking
at
them,
we
have
the
same
exact
thing:
we
have
a
flush
draw.
In
the
bottom
hand,
we
have
a
pair
here
and
we
have
a
card
that
would
yield
a
lot
of
points
if
paired,
but
that
is
higher
than
the
pair
here.
So
there's
a
risk
with
pairing
it
because
you
would
get
a
full.
A
So
I
figured
that
I
will
try
to
an
encoder
that
captures
kind
of
these
similarities,
so
the
encoder
of
the
stable,
the
encoder
that
I
came
up
with,
doesn't
actually
convert
any
cards
to
as
DRS,
but
it
converts
information
about
the
state
of
the
game.
So
it
has
current
value
for
each
hand
number
of
cards
in
each
hand
whether
they're
pairs,
whether
they're
straight
draws
whether
they're
flush
draws.
How
does
your
hair
your
hand
compared
to
your
opponent
number
of
outs
that
will
complete
every
type
of
your
hand
and
so
on?
A
A
We
always
put
well
flash
bottom
or
if
a
card
make
squad
but
put
in
bottom
line,
put
it
there
and
I
wrote
six
hundred
lines,
a
very,
very
poorly
tested
code,
I'd
also
the
list,
the
least
pythonic
code
I've
ever
written.
If
anybody
wants
to
see
something
disgusting,
I
assured
so
this
is
an
image
for
moderate
success.
A
Well,
what
happened
was
new
pic
was
actually
able
to
predict
different
point
values
for
different
starting
hands
and
different
point
values
for
selecting
moves,
so
it
started
to
learn
something.
The
thing
is:
I
haven't
had
time
to
write
the
interfaces
to
test
it
versus
other
machine
learning
techniques
or
humans.
So
it
works
a
little
bit.
It
can
play
the
game.
I,
don't
know
if
it
works.
A
Well,
that's
suggest
to
it
the
interesting
thing
that
I
did
have
time
to
test,
though,
is
I
checked
whether
the
hard-coded
moves
would
work
with
the
card
encoder
where
you
encode
every
single
card
separately,
and
it
didn't
right.
So
that's
the
interesting
part
for
me,
a
new
pic
is
that
if
you
think
about
it
for
those
of
you
who
went
to
the
musical
lecture,
this
is
an
argument
for
encoding
things
like
dissonance
and
cord
versus
encoding,
every
single
note
separately
yeah.
A
So
once
I
get
some
sleep,
I'll
be
able
to
properly
test
the
hard-coded
moves
to
make
sure
that
they
work.
Let
the
algorithm
learn
for
a
while,
because
it's
fairly
slow
it
took
me
maybe
an
hour
to
test
20,000
moves,
so
it's
it
takes
a
while
and
then
develop
an
interface
and
test
it
against
humans
and
see
how
it
works.
Any
questions.
A
B
A
A
Or
what
is
what
is?
It
is
so
yet
the
way
it
works
is
we
have
different
possible
moves
that
are
hard-coded.
Then
we
simulate
placing
them
on
the
board,
create
an
SDR
of
the
state
of
the
board
and
kind
of
create
a
prediction
of
the
value
at
the
end
of
the
game.
From
that
standard
state
of
the
board.
So.