Neural networks Ruby

We assume (based on authority)

After my recent playdate with Ruby, I decide to explore a little bit more. And I’ve been wanting to work on Neural Networks for quite some while, so that’s the pet project of the day. To guide me around, I used an introduction to neural networks

And before you tell me how Ruby is too slow, this is a learning project. I probably won’t build terribly advanced networks. In fact, for starters, it’s going to be a simple Perceptron.

In a nutshell, that thing computes a weighted sum of its inputs and compares it against a threshold. And thanks to Ruby’s simplicity, that’s done in a snap.

  def output
    val = @inputs.zip(@weights).inject(0) { |total, i|
      total + i[0] * i[1]
    }
    val < @threshold ? false: true;
  end
 

Now the usual test case is using those as a simple logic gate. Since I feel like it, here’s the code for an AND gate:

perc = Perceptron.new
perc.weights = [

Source: Groby's Coding Adventures

Morgan Kaufmann High-Performance Communication Networks, Second Edition (The Morgan Kaufmann Series in Networking)
Book (Morgan Kaufmann)

You might also like:

James Kozloski - The Neural Tissue Simulator: An Ultrascalable Infrastructure for Specifying []
James Kozloski - The Neural Tissue Simulator: An Ultrascalable Infrastructure for Specifying [...]
Electronic Neural Network
Electronic Neural Network
Saphenous block
Saphenous block

Basal metabolic rate

2012-01-24 22:58:21 by wounsel

So, on my century ride the other day, I ate a bunch of food to keep pedaling. I noticed that one of the guys on the ride who rode last time didn't seem to eat much. -- He's a vegan. When I asked him what he was going to eat for this ride he told me he had eaten cherries for breakfast, and he would eat some peanuts and some dried berries that he had in his jersey. WTF
What I'm wondering is how this guy can pedal a fixie 100 miles on solely nuts + berries + cherries + some water. It took me 2 oatmeal packs, 1 egg, on egg burrito from mcdonalds (a rest stop on the way), 4 clif bars, 2 granola bars, ~12 pieces of pizza @ cici's, salad & pasta @ cici's.... and when I got home, I was starving. -- one online calculator estimated about 3,900 calorie burn on top of whatever my basal...

Accounting Career

2007-09-05 15:50:59 by deefex007

Hey, i'm 25 and i'm giving up on the whole i wanna b a dj thing i was thinking, LOL. I am deciding i wanna grow up and stop partying and have a career. i know it's a bit late but whatever. I am thinking about going back to school and i think i'd like to major in accounting. now i'm not good with math, but i don't mind adding lots of number, using a calculator all day and doing paperwork. so i'm thinking of getting an associates and then seeing if i can get a job as a accounting clerk and then go to school for my bachelors while i continue working. which would be 2 more years for my bachelors right?. now does anyone think that this is a good idea? i know that not everyone who's in accounting do it because they love it. since i'm not that good at math, should i still do it? i know during...

Punters pick Petricevic's jail term  — Stuff.co.nz
Owned by Victoria University, the iPredict site is designed to reach predictions based on a market trading system between informed buyers and sellers of political and economic event "stocks". The website is posing the question "What percentage of 10 …

Quebec's Jean Charest questions federal push for environmental streamlining  — Victoria Times Colonist
He also said that Quebec has not faced as much resistance from industry as he expected from launching green policies such as a carbon tax and a market trading system to reduce greenhouse gas emissions. But he said it helps when a government shows …

RH Patil: An institutional builder, intellectual, transformational leader  — NDTV
Five months later, the capital market trading system went live. By October 1995, less than a year after launch NSE surpassed the BSE to become the country's biggest stock exchange by trading volume. The dramatic surge in the trading activity through a …

Related posts:

  1. Neural Networks Quiz
  2. Neural Networks DEA
  3. Neural Networks for Excel
  4. Neural networks using C
  5. Neural Networks or Gate