For the complete nerds...

emp

New member
Jun 29, 2006
7,465
211
0
.. such as me.

If you like tinkering with

Artificial Neural Networks
Genetic Algorithms
Swarming Optimization

Here is a new book that is free if you download it as PDF.

Clever Algorithms

::emp::
 


oh yeah, snagged that one a bit ago. all the code is in ruby too :)

it has a section on neural networks too, so if anyone is wanting to learn how to do captcha breaking, slap together a back propagating feed forward neural network and start training
 
slap together a back propagating feed forward neural network and start training
Actually, you would have a lot more success by using GA instead of back propagation.
A simple feed forward network where all weights are packed into an array that becomes a gnome of an individual in a GA population. And the fitness function of GA would be the difference between the expected outcome and output of the network with the given weights.

Then do the normal crossover,mutation, etc. of the population -- generation after generation -- and your networks will evolve. Then pick the best individual and you are all set.

Combining those two approaches is easier to code and it seems to be less prone to falling for local maxima which is common with backdrop.

Ah, good old memories. I guess the geek in me will never die.
 
At first I wasn't interested, but then when someone said all the code was in ruby I thought I should pick up a copy. Thanks a lot for this share!
 
bcc423 you are just swapping the optimization method into a genetic algorithm, that technique is still a neural network.

The local maxima (actually, it would be minima, as ANNs try to minimize errors) are a problem with a backprop, though.

::emp::
 
In other news:
So it has been decided.... ruby is my next language.
ARGH.. and I was almost set on python.

::emp::
 
In other news:
So it has been decided.... ruby is my next language.
ARGH.. and I was almost set on python.

::emp::

I'm still a newb so to speak at ruby, but i get to love it more and more every day! really easy when you need it to be, and really powerful with a C backend.
 
bcc423 you are just swapping the optimization method into a genetic algorithm, that technique is still a neural network.

Yep, that's what I said, isn't it? :)
 
Ever since dchuk's off-handed "try python or ruby" recommendation in my Google scraper thread, I've been a Ruby addict.

Saw this book on reddit.com/r/ruby the other day. Good share. Swarm intelligence especially interests me.

learn ruby and python at the same time. thank me later.

Best reason to do this is to develop your own preference.

Finally, RubyMine is only $30 til mid-February.
 
Best reason to do this is to develop your own preference.
No, sorry, developing your own preference is a good reason to do this, but the best reason to do this is pretty simple -- If you have two separate-but-similar projects, and you can write them in two separate-but-similar languages, at the same time, you'll be a better coder for it.

Here's why --
* Ruby and Python (and Rails and Django) have lots of "magic", and that's a good thing. Magic saves me thousands of hours per hour -- read it again, THOUSANDS OF HOURS PER HOUR.
* But real "magic" is invisible to the developer and you won't learn what that magic is until you no longer have it.
* When you use a language/framework, you become addicted to it's "magic" and you wind up needing that magic in everything you do. There's nothing wrong with this, that's just part of gaining mastery over a toolset.
* When you switch to a different language/framework, and your usual "magic" disappears, you're forced to understand a) Where the magic was, b) What the magic was doing for you, and c) Why that magic is important.
* Then, if you want to re-implement the magic, you have to know enough about both languages/frameworks to make a translation between the two.

A perfect [albeit simplistic] example -- In Rails, the code-logic-that-powers-a-template (Rails: "Controller", Django: "View") automagically guesses what the names of the associated HTML template (Rails: "View", Django: "Template") will be, from the name of the code block.

E.g. A Rails action like UserController#Edit would automatically render /app/views/user/edit.html.haml

This is great and handy and useful!
But, let's say I'm a new Rails developer coming from a PHP background. Once I figured out this magical paradigm, I'll stick my code in my controller, and my HTML in that view file, but would I ever even realize that I can force the same action to use different templates? Would I truly understand what Rails is doing behind the scenes here, or would I be leveraging the magic without understanding it?

Example part two -- Then, I start a Py/Django project for something. In Django, I define a View and a Template (analogous to a Controller/Action and a View in Rails), but I have to explicitly render the template inside the view, and return it as an HttpResponse() object to the WSGI gateway. Now, looking back at Rails, I'm able to say "Oh, Rails guesses my template for me from the controller, what a nifty feature!". Using what I know about Python, I then create a new function decorator to emulate the Rails shorthand --
Code:
Old way:

def user_edit(req):
  return render_to_response('user/edit.html', {'message': 'Put this message into the template'},
    context_instance=RequestContext(req))

My new way, emulating Rails's magic:

@guess_template()
def user_edit(req):
  return {'message': 'Put this message into the template'}
Voila, padwan. I have exhibited mastery over both languages that I would not have attained from using a single language alone.
I have created my own magic. This is the difference between someone who codes one thing and sticks with it, versus someone who learns them all.
 
Geez... language wars?

I have dipped and diven into so many laguages along the years, it is not even funny.

But I am ready to settle down now and have nice little code kids with a language I can respect... ya, right.

Going with ruby next.

::emp::
 
Geez... language wars?

I have dipped and diven into so many laguages along the years, it is not even funny.

But I am ready to settle down now and have nice little code kids with a language I can respect... ya, right.

Going with ruby next.

::emp::
No wars, homie, I party with both teams, I'm just advocating you do the same, for your own sake.
 
Just wanted to say it is not a "one shot, winner takes all" decision.

I have written code in so many languages, this is more like a "what's the first one going to be"

Right njow, watir interests me, as does the book I linked.

ANNs and GAs are subjects of extreme fascination for me.

::emp::