[Noisebridge-announce] ML Wednesday: code up a neuron!

Josh Myer josh at joshisanerd.com
Tue Mar 10 20:48:49 UTC 2009

Hey, an early announcement, crazy!

Tomorrow night, 8PM, at 83c, we'll have a machine learning workshop.
This week's ML Wednesday is going to be another experiment in format.
We'll have a real quick introduction to perceptrons (cute little
baaaaby neural networks), then we'll all code one up in our language
of choice.  By the time you leave, you should have written your own
little artificial neuron.

To that end, I need a couple of things from the audience:

1. My ML-aware peeps to step up to shepherd a bit on Wednesday night
   (You've all been awesome about this thus far, so I'm not worried
   about it.  You might want to brush up on the learning  algorithm 
   used, though.  I'll do a preso, too, so it should be smooth going.)

2. Some sample code in your language of choice.  As long as you can
   write a the following function, we're probably good.  Here's that
   function; please have it working before you come Wednesday.


takes two arrays of equal length, multiples them along each other, and
sums the products.

Test cases for dot_product:

dot_product([0],[1]) = 0
dot_product([1,2,3,4],[1,10,100,1000]) = 4321

And, a quick version in accessible ruby:

def dot_product(a, b)
  sum = 0.0
  i = 0

  while(i < a.length)
    sum += a[i]*b[i]
    i += 1

  return sum

If this experimental format goes well, we could move on to doing more
complex neural networks on top of the same ideas in another workshop,
or maybe try some other learning algorithms in the same format.

I hope you can join us and build your own little learner tomorrow!
Josh Myer   650.248.3796
  josh at joshisanerd.com

More information about the Noisebridge-announce mailing list