To Use the Movidius neural network stick we have to use caffe.

Caffe is not super friendly or well documented in my opinion.

I’m having lots of installation problems on my mac.

Segmentation Fault 11

Trying the last thing here. Be sure to change the version numbers in the path

I eventually got it to import with

PYTHON_INCLUDE := /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7

PYTHON_LIB := /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib

in MakeFile.config

I run the command with python2 which supposedly is the homebrew python.

python2 -m pip install protobuf scikit-image

Ok. Now we can start.

It is configuration file based. You make this protobuf file with the network and then load it up.

In standard configuration, you pull the data off of a database.

Data layers have the training data

top parameter is output of a layer

bottom is input

include Train Test are ways to include different guys at different stages

Any loss layer contributes to the eventual loss. You can weight them with a weighting parameter.  The solver runs to optimize loss layers by default. There is no parameter to specify which.

Some beginner files for syntax and exploration.

Sets input blobs in python (probably not the preferred methodology but it is fast to get up and running. Should probably at least dump into an hdf5)

Performs InnerProduct which is a matrix product and computes a euclidean loss.

Check out the mnist folder in caffe/examples. It has the clearest stuff.

name: "SimpleMult"
#input: "thedata"
#input_dim: 2
#input_dim: 3
#input_dim: 100
#input_dim: 101
layer {
  name: "inarray"
  type: "Input"
  top: "thedata2"
  input_param { shape: { dim: 1 dim: 1 dim: 2 dim: 5 } }
layer {
  name: "inarray2"
  type: "Input"
  top: "trueoutput"
  input_param { shape: { dim: 1 dim: 1 dim: 1 dim: 1 } }

#  name: "scalelayer"
#  type: "Scale"
  bottom: "thedata2"
  top: "scaleddata"


  name: "innerlayer"
  type: "InnerProduct"
  bottom: "thedata2"
  top: "ip"
  inner_product_param {
      num_output: 1 #the thing produces 1 output, the inner prduct. num_output however goes into the channel dim
      weight_filler {
        type: "gaussian"
        std: 0.01
      bias_filler {
        type: "constant"
        value: 0

  name: "loss"
  bottom: "trueoutput" #needs two bottoms to compare
  bottom: "ip"
  top: "loss"
  loss_weight: 1

import sys
import numpy as np
import matplotlib.pyplot as plt

import caffe

#load numpy array into caffe
net = caffe.Net('simplemult.prototxt', caffe.TEST)
print("inputs " , net.inputs)
print("blobs ", net.blobs)
print("params ", net.params)
print(net.blobs['thedata2'].height) # num, width,

myarray = np.arange(10).reshape((1,1,2,5))
output = np.arange(1).reshape((1,1,1,1))
print("start forward")

net.blobs['thedata2'].data[...] = myarray

net.blobs['trueoutput'].data[...] = output
print("start forward")
out = net.forward()

#out = net.forward()

#net.blobs['data'].data[...] = transformer.preprocess('data', im)

#Using a Solver.
#solver = caffe.get_solver(solver_prototxt_filename)
# if intending to import network for solving
# import via get_solver, then set input data using[]

#use caffe to mutiply

# receive numpy array

# The train/test net protocol buffer definition
net: "examples.prototxt"
# test_iter specifies how many forward passes the test should carry out.
# In the case of MNIST, we have test batch size 100 and 100 test iterations,
# covering the full 10,000 testing images.
test_iter: 100
# Carry out testing every 500 training iterations.
test_interval: 500
# The base learning rate, momentum and the weight decay of the network.
base_lr: 0.01
momentum: 0.9
weight_decay: 0.0005
# The learning rate policy
lr_policy: "inv"
gamma: 0.0001
power: 0.75
# Display every 100 iterations
display: 100
# The maximum number of iterations
max_iter: 10000
# snapshot intermediate results
snapshot: 5000
snapshot_prefix: "examples/mnist/lenet"
# solver mode: CPU or GPU
solver_mode: CPU

This is the location of

It has some routines for conversion to and from arrays and preprocessing in Transformer.

You can set certain layers to not train by setting learnign rate to 0