►
Description
By Rian Shams.
A Racket-based implementation of the current temporal memory algorithm.
A
My
name
is
rion,
and
so
the
title
of
my
hack
is
temporal
memory
and
racket,
and
so
what
I'm
essentially
going
to
be
talking
about
is
how
one
might
implement
the
the
new
temporal
memory,
algorithms
that
chetan
recently
released
in
a
programming
language
called
racket.
So
the
reason
I
chose
this
hack
is
actually
kind
of
selfish.
A
So
essentially
it's
all
about
purely
transforming
information
from
one
data
structure
to
another,
and
that's
that
was
sort
of
really
interesting
to
me
and
what
I
absolutely
did
not
care
about
was
speed.
So
this
is
really
a
toy
implementation.
I
just
want
to
see
something
work
and
make
sure
that
I
sort
of
understand
this
entire
process,
so
that
was
not
an
issue
for
me
at
all,
so
that's
sort
of
why
you
know
my
favorite
clarity
over
speed,
at
least
for
now.
A
A
Actually,
racket
is
being
used
right
now
across
many
different
middle
schools
and
high
schools
as
their
first
programming
language.
So
I
feel,
like
a
lot
of
students
are
getting
into
this
sort
of
into
this
language
very,
and
I
am
also
considering
myself
a
novice
program
programmer
I've
kind
of
been
at
it
for
less
than
a
year,
maybe
nine
months,
and
so
the
motivation
for
me
to
start
programming
was
you
know
on
intelligence
and
these
algorithms,
so
I
had
tried
a
couple
of
times.
A
Mine
was
hello
world.
Well
I
did
that
too,
but
yeah,
and
so
the
other
thing
I
want
to
talk
about
about
what
makes
racket
unique
amongst
not
only
the
the
list
in
general,
but
all
languages.
Is
that
there's
a
really
succinct?
I
don't
know
natural
language
is
very
important
to
this
community,
there's
a
very
succinct
mapping
between
how
we
represent
natural
language
and
how
we
represent
a
programming
language.
A
So
in
essence,
in
racket
everything
can
be
thought
of
as
a
domain-specific
language
as
I'll
sort
of
get
into
briefly,
and
the
idea
is
that
over
time,
essentially,
you
end
up
creating
code
or
program
that
essentially
fits
or
maps
to
your
program.
So
it's
essentially
your
evolving
code
to
fit
or
solve
your
exact
problem
and
that,
I
think,
is
pretty
cool,
so
those
are
the
ys,
and
now
I
wanted
to
just
touch
on
some
of
the
differences
between
the
implementation
that
I'm
working
on
and
chetan's
implementation
in
python.
So
there
are
not
that
many
differences.
A
I
essentially
wanted
to
make
sure
that
the
mapping
was
as
close
as
possible,
but
there
are
some
slight
deviations.
So
first
you
know
in
in
racket.
We
there
are
no
classes
at
all
so,
like
I
mentioned
before,
it's
just
pure
information
moving
from
point
a
to
point
b.
So
that's
the
first
thing.
The
other
way
is
sort
of
how
you
iterate
your
functions
and
we-
or
at
least
I
like
recursion
recursion,
is
kind
of
you
know
you
have
a
love-hate
relationship
with
it.
Some
people
love
it.
A
Some
people
hate
it
actually,
there's
this
cool
quote.
I
found
to
iterate
as
human
to
a
curse
is
divine,
and
you
know
it
just
kind
of
goes
along
with
sort
of
your
own
philosophy,
but
you
can
do
a
lot
of
really
interesting
things
with
different
types
of
recursive
techniques
that
are
a
lot
more
difficult
to
do
with
you
know,
using
different
types
of
loops
and
the
other
thing
and
kind
of
what
slows
this
implementation
I'm
working
on
is
that
I
wanted
one
uniform
data
structure.
That's
it
I
just
wanted.
A
I
didn't
want
any
sort
of
confusion,
and
so
I
went
with
the
list
list
because
you
know
this
is
actually
short
for
list
processor.
So
you
know
just
that
was
pretty
important
to
me
as
well,
and
you
know
in
this
implementation
learning
is
always
on,
and
I
know
that
you
have
the
opportunity
to
turn
it
off,
but
I
just
didn't
get
time
to
sort
of
think
about
that
yet,
but
we'll
implement
that,
hopefully
pretty
soon-
and
many
of
you
guys
probably
know
this
guy
and
one
of
the
things
he
says
is
talk
is
cheap.
A
Show
me
the
code,
so
I
don't
normally
like
to
show
code,
especially
in
a
presentation,
but
I
think
it's
just
going
through
a
couple
just
the
main
function.
A
couple
of
let's
see
if
I
can
get
this
work,
a
couple
other
things
and
show
you
kind
of
what
I
mean
by
sort
of
kind
of
clarity
and
a
really
nice
mapping
from
natural
language
programming
language.
So
this
is
essentially
the
idea
is
given
your
main
computing
function
for
how
we
do
temporal
memory.
It
should
be
the
exact
same.
A
You
know,
given
the
same
input,
you
should
get
the
exact
same
output
as
the
weights,
it's
written
in
python,
so
one
of
the
main
differences
I've
talked
about
is
sort
of
no
classes
at
all.
So
the
way
we
kind
of
get
rid
of
this
idea
of
not
needing
classes
is
essentially
at
each
moment
in
time,
feeding
in
all
the
neurons
in
their
associated
segments,
and
so
this
is
obviously
very
long
and
very
tedious,
but
you
kind
of
know
at
any
point
in
time.
A
You
know
where
your
data
is
and
sort
of
what
the
state
of
your
temporal
network
is.
So
that's
sort
of
one
of
the
major
differences,
the
other
one
is
just
kind
of
the
the
use
of
this.
This
local
functions
are
defined
locally
here,
so
just
kind
of
you
know
you
can
compute
your
current
active,
neurons,
they're
used
to
compute
the
active
segments
and
so
forth.
A
A
So
basically,
instead
of
we
basically
only
have
these
three
learning
update
functions
and
the
idea
is
that
you,
just
essentially,
as
you
recur
here's,
so
here's
kind
of
the
natural
recursion,
so
we
compute
so
basically
recursion
is
just
for
anyone
who's
not
familiar
with
it
is
once
you
define
a
function,
you
call
that
same
function
within
the
function.
A
So
what
we're
doing
is
we're
essentially
not
worried
about
the
state
of
the
program
at
all,
and
the
only
thing
that
we
actually
output
is
what
goes
up
into
the
cla
classifier,
so
the
active,
neurons
and
and
the
rest
of
the
the
outputs
kind
of
stay
within
the
recursive
system,
and
only
you
know,
we
only
need
them
in
order
to
actually
you
know
and
as
the
data
sort
of
flows
from
your
sequences,
so
so
yeah.
So
this
is
how
we
kind
of
continue
the
process
and
yeah.