►
From YouTube: The NuPIC Network API
Description
Subutai Ahmad, Numenta VP of Research, talks about NuPIC's Network API.
A
Hello
toothpick:
this
is
us
I'm,
stupid
I.
Am
it
I'm
gonna
be
talking
about
the
no
pig
Network
API,
and
this
is
another
one
of
those
informal
chalk.
Talks
at
least
was
going
to
be
a
chalk
talk
on
the
whiteboard,
but
then
I
decided
slides
would
be
better.
So
it's
not
quite
as
informal
I
guess,
because
I've
slide,
but
it's
pretty
informal
and
around
me
have
the
dementia
folks
and
they're
all
eating
lunch.
A
Though
there
are
slides
here,
so
it's
in
that
spirit,
okay,
so
what
is
this
presentation
so
basically
I'm
going
to
define
and
cover
the
so
called
network
API,
which
you
might
have
heard
discussion
about
it?
It's
part
of
our
new
Pig
roadmap
and
what
we're
trying
to
do
for
a
lump
on
your
release.
This
is
primarily
for
more
experienced
new
pig
developers.
It's
not
really
for
the
newbie
you
may
or
may
not
get
if
you're
new
to
new
think
you
may
or
may
not
get
something
out
of
this.
A
This
is
primarily
for
people
who
want
to
run
experiments
using
novel
network
structures
or
structures,
or
if
you
want
to
create
HTML
occations
that
are
different
from
the
normal
streaming
examples
that
we
have
are.
If
you
really
want
to
contribute
to
the
core
of
nupoc
and
the
picked-up
core,
then
this
might
be
useful
to
you.
The
stuff
I'm
going
to
talk
about
covers
both
C++
and
Python.
It
does
not
cover
Java.
A
C
C
A
B
A
At
a
really
low
level,
we
have
classes
that
implement
different
algorithms
and
we
have
two
different
algorithm
routine.
So
we
have,
for
example,
spatial
cooler
CTP,
which
is
the
simplest
of
this
picture,
cooler
or
temporal
memory
of
Pi,
which
is
a
Python
implementation
of
temporal
memory
in
sequence
and
learning.
So
you
can
you
know,
that's
one
level
which
you
can
use
new
bit
then
there's
a
network
API
which
I'll
cover
and
then
at
the
highest
level.
A
There's
frameworks
so
we'd
have
the
online
predict
prediction
framework,
the
OPF
or
we
have
the
HTM
engine
which
we
released
recently.
So
that's
kind
of
the
highest
level
at
which
you
can
use
it.
Here's
an
example
of
using
the
low
level
routine.
So
this
is
I,
think
hello
T
beat
up
high
or
something
example.
It's
so
a
slightly
truncated
version
of
that.
But
basically
you
can
see
that
here
you
can
access
the
temporal
memory
directly
at
the
top
you
have,
but
at
the
top
you
instantiate
the
class.
A
A
You
can
do
things
at
that
level,
so
this
is
really
flexible
because
you're
dealing
with
the
temporal
memory
directly,
but
you
do
need
to
know
quite
a
bit
about
the
algorithms
to
be
able
to
make
sense
of
this
and
the
other
end
of
this
scale.
We
have
the
online
prediction
framework
LPF,
which
is
one
of
the
frameworks.
A
This
is
very
high
level.
You
don't
need
to
know
anything
about
the
algorithms,
so
you
create
a
model
at
the
top.
The
OPF
defines
a
particular
input
format,
so
you
can
open
a
CSV
file
and
you
have
to
format
the
data
in
the
way
it
expects,
which
is
all
this
stuff
about
model
inputs
here
and
then
you
give
the
model
one
record
at
a
time,
and
then
you
can
you
get
back
predictions
so
here
you
don't
need
to
know
anything
about
the
algorithms
or
how
it
took
tup.
A
What's
actually
going
on
underneath
the
scene
is
that
you
have
sensors
and
spatial
pool
or
a
temporal
memory
and
let's
see
how
they
classifier
and
all
sorts
of
wiring
and
stuff
that's
going
on.
But
you
don't
need
to
know
anything
about
that.
You
just
feed
that
data
and
get
back
about
predictions
so
basically,
depending
on
what
level
you
want
to
be,
it
was
different
ways
you
can
use
it
and
the.
A
C
A
A
Is
somewhere
in
between
it's?
This
is
supposed
to
be
pretty
flexible
and
it's
somewhat
hard
you
know
under
either.
You
need
to
know
too
much
about
the
plumbing
of
the
algorithms,
but
you
kind
of
need
to
understand
the
algorithms
a
little
bit
too.
So
it's
somewhere
in
between
it's
really
the
frameworks
used
in
it
where
network
ap
is
the
OPF
there's
one
example,
client
of
using
the
network
API
and
the
HTM
engine
is
as
well.
A
A
A
Worked
this
is
an
image
I
work.
You
might
create
this
write-up.
It's
got
two
levels
in
the
hierarchy,
each
level.
So
there's
an
image
sensor,
which
reads.
The
images
then
passes
that
to
a
spatial
cooler
than
a
temporal
memory
and
another
special
pool
in
a
temporal
memory
and
then
eventually
a
classifier.
This.
A
Code
block
that
was
used,
the
same
code
block
for
spatial
pooling
should
be
used
in
almost
level
one
or
level
2
with
this
converging
or
not.
The
algorithm
should
need
to
worry
about
the
network.
Topology
I
thought
that
they
should
just
work.
Here's
another
example
which
introduces
feedbacks,
and
now
you
have
inputs
from
level
2,
maybe
going
back
into
level
1,
and
you
should
be
able
to
create
networks
of
this
topology
as
well.
So.
C
A
This
is
a
pretty
key
slide
because
it
really
informs
a
lot
of
the
design
decisions
that
were
made
in
the
networking
you
know
and
why
things
are
the
way
they
are
so
one
is.
You
should
be
able
to
create
these
other
design.
Both
you
should
be
able
to
create
and
run
almost
any
HTM
network.
Topology
I,
don't
think
everything
can
be
creative,
but
you
can
create
a
lot
of
them.
It's
good
have
extensible
object-oriented
design,
and
so
you
can
extend
the
code
block
and
write
your
own
algorithm
implementations.
A
Hence
it's
very
fast,
so
there's
minimal
overhead
and
actually
really
very
few
features
in
here
and
that's
the
potential
it's
intentionally
very
flexible.
That
way
you
can
do
a
lot
of
stuff
and
you
can
actually
get
yourself
in
trouble
as
well.
Okay,
it's
this
minimal
overhead
involved
in
the
networking
guy.
The.
B
A
Thing
we
have,
we
don't
have
just
one
implementation
of
pooling.
We
have
lots
of
implementation
of
spatial
pool
again
you
can
our
temporal
memory
or
pooling
or
other
things,
and
you
can
actually,
we
have
a
support,
vector
machine
webcam,
a
classifier
you
can
put
in
anything
some
of
the
things
we
intentionally
decided
not
to
do
here.
One
is,
it
does
not
inherently
support
parallelism,
you
could
build
it
in,
but
there
was
no
thought
the
parallelism
put
in
here.
That
was
very.
A
This
is
for
those
of
you
befalling
momento
five
years
ago.
Yes,
seven
years
ago,
we
had
another
version
of
the
thing
and
it
did
support
parallelism
and
we
could
run
stuff
on
clusters
and
stuff
and
that
ended
up
being
completely
unused
and
added
a
lot
of
complexity.
So
this
version
we
just
decided
not
to
do
any
of
that.
It
also
does
not
support
dynamically
changing
network
topology.
So
you
kind
of
define
a
network
structure
out
front,
and
then
you
can't
add
it
you
kind
of
save
it
out
of
it.
C
A
B
A
C
A
A
In
the
region,
so
let
me
first
talk
about
the
network.
The
object
model
is
pretty
simple:
it's
just
a
container
for
regions
and
links
between
regions
and
shows
some
of
the
main
interface
functions.
You
can
add
a
region,
you
give
it
a
stream
name
and
a
string,
type
and
strain
friends.
If
you
can
see
if
it's
all
strings
and
params
usually,
is
that
Chase
implemented
and
there's
a
method
called
link
that
will
link
two
regions
together.
A
So
you
can
have
a
source
region
in
the
destination
region
in
region
can
have
multiple
inputs
and
outputs
to
be
specified,
output
and
input.
You
can
run
the
network
and
you
can
load
and
save
it,
and
I
should
mention
that
the
loading
and
saving
the
serialization,
where
the
process
of
transitioning
to
more
packing
proto
great
stuff
there.
A
A
A
A
A
few
things
it
defines
inputs
and
outputs
parameters
that
you
can
get
in
set
and
a
core
compute
call
and
yeah
three
main
things:
I
use
that
to
the
visual
depiction,
here's
a
region,
I
can
be
anything.
Each
region
can
have
any
number
of
named
inputs
and
any
number
of
named
outputs.
So
he
puts
a
stream
name
associated
with
them,
because
many
outputs,
the.
A
A
A
A
A
A
Ignore
it,
and
always
in
the
code
you'll
see
that
this
is
the
complexity
we
put
in,
that
we
thought
we
would
need
and
we
use,
but
then
eventually
about
not
meeting.
So
when
the
network
is
run.
What
happens
is
that
the
output
from
region
1
in
this
case
input
1,
will
be
automatically
copied
into
the
input
for
region
2,
so
it
happens
is
that
it's
a
region,
ones,
computers
called
now
reagent
just
before
region
to
this
computers
called
the
output.
D
B
B
C
D
A
The
code
for
creating
this
network,
you
have
net,
create
a
network,
you
add
region
1,
you
have
to
give
it
a
type,
so
that's
also
a
stream
and
then
any
parameters
that
are
appropriate
for
that
region,
and
typically
this
is
adjacent
for
minutes.
Training
like
I
mentioned.
So
now
you
add
region
2
same
way.
You
link
these
two
together.
Now
you
can
run
it
for
some
number
of
iterations
and
then
you
can
save
it
up.
D
B
A
A
B
B
A
A
D
A
D
A
A
There
is
no
how
to
put
up
a
network.
Okay,
there's
just
you.
Can
you
know
that
sort
of
application
dependent?
If
you
want
to
read
up?
That's
it
is
the
classifier
and
you
there's
a
categories
coming
up.
You
could
put
in
your
code
here
code
to
read
in
the
output
from
that
region,
but
there's
no
predefined
outputs.
Any
code
block
could
be
an
open
and.
C
B
A
B
A
Later,
which
is
here
so
there's
these
things
about
parameters
and
clients
code
can
get
and
set
parameters
at
any
point
in
time
is
an
example
of
that.
So
that
say,
you
had
a
region
whose
name
was
spatial
polar
region.
You
can
access
that
in
Python.
This
way
from
your
network,
you
can
get
it
and
then
now
you
can
set.
A
Look
at
it
by
print.
That's
that's
backward!
You
just
look
at
the
code,
but
it's
a
couple
of
advanced
things,
so
this
goes
specular
chaiten
was
asking
that
so
you
can
control
the
order
of
execution,
so
there's
an
inherent
face
associated
with
each
region
by
default.
The
phase
of
the
order
in
which
you
add
the
regions
to
the
network,
but
you
can
run
a
subset
by
setting
a
mint
phase
and
a
max
face.
If
you
said
the
mint
phase
for
two
and
max
phase
before
and
then
you
do,
net
dot
run.
B
A
D
A
A
D
A
Well,
no,
this
is
if
it's,
if.
A
C
A
A
A
S
FD
R,
which
is
the
actual
spatial
pooled
our
class.
That's
what
this
is
the
low-level
algorithm
class
and
now,
once
you
have
that
you
can
now
you
have
access
to
the
low-level
routines.
You
can
do
all
this
stuff,
you
normally
would
in
the
lowest
level
they
actually
that's.
For
example,
you
might
want
to
get
the
boost
factors
for
the
spatial
Euler
now.
C
C
A
A
Okay,
so
this
is
the
simplest
one.
I
found
was
also
a
real
example.
Is
the
image
test
thing?
That's
a
new
research
in
it
I
think
that's
in
nuclear
fission,
now
syndication,
okay,
so
I
stripped
out
a
little
bit
of
it,
just
just
for
the
presentation,
but
here's
the
function
that
creates
the
network.
And
basically
this
is
a
very
simple
thing
that
takes
images,
goes
for
an
SP
and
then
K&N
classifier.
So
you
can
see
that
this
3
ad
region
calls
I'm,
calling
the
image
sensor
sensor.
A
Only
the
spatial
flow
region
SP
and
this
one
classifier
and
then
there's
a
link
called
to
make
the
spatial
cooler
I'm.
Sorry,
the
sensor
to
the
SP-
and
in
this
case
we
use
the
data
out
output
of
the
image
sensor,
which
and
here's
what
Scott
was
talking
about.
In
our
algorithm
code.
We
have
conventions
for
inputs
and
outputs
bottom-up.
B
A
A
And
then,
in
the
case
of
a
classifier
network
image,
most
of
our
regions
also
have
a
cat
as
a
categories
output
as
the
classifiers,
the
supervised
learning
things.
So
he
needs
the
input
and
the
category
to
be
able
to
associate
the
two.
So
here
you
can
link
the
category
out
output
of
the
sensor
into
the
category
in
input
of
the
classifier.
A
C
A
You
can
tell
it
to
low
of
images
from
a
particular
directory
and
then
once
it's
done,
that
you
can
get
its
parameter
called
num
images
to
figure
out
how
many
images
that
are
actually
loaded
and
then,
in
this
case,
I'm
training.
The
spatial
fool
in
first
I
didn't
use
faces
here.
I'm
just
setting
the
classifier
inference
and
learning
look
to
be
off
the
spatial
cooler
learning
mode
could
be
one
and
then
I
for.
However,
many
training
images
I
have
this
one
moves
through
the
training,
division,
felicity's
and.
A
A
And
whatever
category
happens
to
be
up
in
the
sensor
happens
to
be
outputting.
This
is
an
example
of
you
way
how
you
can
feel
good
data
and
then
I
just
save
it
out
and
you
can
get
at
the
end.
You
can
get
specific
parameters
if
you
want
to
figure
out
how
many
categories
that
and
learning
patterns
are
stored
in.
A
This
is,
if
you
want
to
implement
your
home
region
and
I'm,
not
going
to
go
into
a
lot
of
detail
here,
almost
done,
but
just
a
few
slides
on
this,
so
region
implementation
can
be
in
C++
or
Python
and
in
C++
you
actually
have
to
subclass
from
region
in
pull
and
then
register
the
class
with
region
and
olfactory,
and
that
allows
you
when
you
do
add
region.
It
knows
how
you
create
that
class
and
in
Python
you
have
to
subclass
from
PI
region
and
I'll
show
make
that
both
of
this
and
you
have
to.
A
A
A
A
A
Input
so
their
feet
forward
input,
it's
got.
Some
other
puts
that
are
defined
here
that
you
can
get,
and
here
all
the
parameters
you
can
set
and
get
so
you
can
turn
here's
a
learning
mode.
You
can
turn
it
off
or
on
of
this,
this
access
mode
tells
you
whether
you
can
set
and
get
it
or
just
get
it
over
to
Max's.
A
A
Here's
the
opinion
this
is
a
basic
Python
constructor
in
Python.
You
can
have
keyboard
arguments
that
if
they
match
what
happens
is
when
you
create
a
region,
any
anything
in
the
Jason
I
mean
the
Jason.
It
basically
gets
passed
as
starts
our
keyword
arts
into
this
constructor.
So
they
have
people
values.
B
A
A
A
It's
passed
in
and
it's
a
constructor
parameter
and
there's
a
member
variable
called
alpha.
It's
the
same
name
and
in
set
and
get
parameters.
You
don't
have
to
do
anything
special
to
handle
output
it'll
just
it
does
Python
introspection,
and
it
just
knows
that
when
you
call
set
parameter
with
alpha,
it
knows
which
one
to
set
and
here's.
A
A
C
A
Doesn't
say
anything
about
the
format
of
an
individual
regions
data,
so
you
can
save
it
in
whatever
format
you
want
and
python
we
often
use
pickle
and
c++
is
a
variety
of
formats
we
use.
We
are
transitioning
to
captain
proto
and
I'm
not
going
to
say
too
much
about
that,
but
I
think
this
will
just
formalize
the
region
serialization.
A
A
There's
support
for
multiple
languages,
but
this
makes
the
interface
very
basic,
so
everything
uses
strings
and
floats,
and
this
is
can
be
a
little
awkward.
Sometimes
so,
there's
no
object
types
really
other
than
the
basic
types
it
uses
fixed
size
floating
point
buffers
for
communication.
You
can't
change
that.
You
can't
put
types
in
there
for
that
right
now,
I
mentioned.
D
A
C
A
A
A
But
not
great
documentation
and
some
more
simple
examples
would
be
good
and
the
thing
I
get
up
frustrated
about
if
the
Dybbuk
code
often
is
quite
complex
and
doesn't
always
follow
some
of
the
networking
conventions
which
tries
to
kind
of
get
around
things
and
tidy
the
shortcuts
and
so
and
that's
okay
in
the
short
term.
In
the
long
term,
it
ends
up
looking
really
complicated
and
ugly
I.
Think
Marian
did
a
great
job
of
cleaning
up
like
the
CLA
classifier
was
an
example
of
that
did
a
lot
of
it
didn't
use
the
computation
that
did.