
cPerceptron: A neural network (Simple Perceptron) implemented in PHP. - gzanitti
https://github.com/gzanitti/cperceptron
======
jacques_chester
This makes me think I should upload my random computational intelligence
assignments and get sweet, delicious karma.

Edit: OK, I was a bit snarky, but I'm serious.

I see these things on HN all the time. These are, quite literally,
undergraduate projects.

I don't see people upvoting "My First Stack" or "Check out this Pet Shop I
wrote in J2EE". Computational intelligence is not some land of super wise
geniuses that mere mortals cannot ascend to. It's all pretty straightforward.

Eg, my Ant Colony Optimiser for a Travelling Salesman Problem:

<https://github.com/jchester/ruby-ry48p-aco>

and my Genetic Algorithm for optimising Ackley's Function:

<https://github.com/jchester/ruby-ackley-genetic-algorithm>

~~~
jacquesm
> This makes me think I should upload my random computational intelligence
> assignments and get sweet, delicious karma.

Does karma matter that much to you?

> Edit: OK, I was a bit snarky, but I'm serious.

Well, what's stopping you? The fear of getting people to hate at you like this
in comments? Really, you can do much better than this.

> I see these things on HN all the time. These are, quite literally,
> undergraduate projects.

They are people taking steps on the ladder to proficiency, as such they should
be encouraged rather than be beaten down.

> I don't see people upvoting "My First Stack" or "Check out this Pet Shop I
> wrote in J2EE".

I don't see people submitting those either, which is one reason they're not
being voted up. Once upon a time you too were a beginner. And in the eyes of
many you probably still are.

> Computational intelligence is not some land of super wise geniuses that mere
> mortals cannot ascend to. It's all pretty straightforward.

Exactly! And what better way to demonstrate that by showing it, in a language
that is generally despised.

> Eg, my Ant Colony Optimiser for a Travelling Salesman Problem:

> <https://github.com/jchester/ruby-ry48p-aco>

> and my Genetic Algorithm for optimising Ackley's Function:

> <https://github.com/jchester/ruby-ackley-genetic-algorithm>

That's pretty neat code ;)

~~~
jacques_chester
> _Does karma matter that much to you?_

Revealed preferences suggest that it does :(

> _That's pretty neat code ;)_

Flattery will get you karma beyond your wildest dreams (for wildest dreams =
1).

~~~
jacquesm
> Flattery will get you karma beyond your wildest dreams (for wildest dreams =
> 1).

It's encouragement, not flattery.

------
xaa
Nice. Sort of the computational equivalent of 'A model of Neuschwannstein
Castle made out of spaghetti'.

~~~
jacquesm
The code isn't all that bad, the spaghetti reference might give that
impression.

PHP gets a bad rap because 'it's not a real language after all' but frankly I
don't care what language you use if you write neat code like this that's an
automatic 'pass'.

You can write spaghetti code in any language, but this isn't it.

~~~
slurgfest
I suspect that comment was more about the analogy of building detailed models
out of pasta; in other words, that the subtext was that it looks like a
painstaking technical feat achieved with strange materials for the purpose.
And maybe in that respect all the more impressive.

PHP gets a bad rap because of problems with its design and implementation and
some loosy-goosy culture (though most of these can be worked around or
smoothed over by a framework and personal discipline, core language issues can
be a form of technical debt). Really fixing this might require a breaking new
version like Perl 6 or Python 3. But of course you can still build things with
it. Like models of Neuschwannstein Castle ;)

------
jacquesm
That's pretty neatly written code!

If you've mastered PHP then you could easily make the switch to C or C++ for a
very large speedboost while still being able to recycle a large chunk of your
code. PHP and C look quite alike (drop the $ signs and add declarations and
you're halfway there).

Neat to see you interested in doing more advanced stuff than just web bits and
pieces.

------
icelancer
Always nice to see these pet projects as proof of concept for ML in PHP.
There's a bunch of them, but the more, the merrier.

------
tzaman
I find it quite interesting how PHP developers try their best to encrypt their
function names as much as possible? rdmFloat? Why not randomFloat or
random_float?

This particular example isn't very problematic, but I see this pattern in PHP
way more than in other languages.

~~~
jacquesm
Naming things is tricky. I got into programming when 6 character assembly
labels were the norm. You can imagine what that led to. I _still_ catch myself
dropping vowels from function names every now and then (rndflt anybody?).

What's pretty good about this code is that it is neatly laid out, the
modularity is just about right and it solves a particular problem and provides
a bit of text showing how the bits get put together to make it work.

As such it beats a very large number of the github projects out there. Brevity
in function names is easily forgiven when the code itself is this easy to
read.

But I'm with you on the basic principle and I'd vote for random_float.
iNeverCouldGetTheHangOfCamelcase.

------
akie
Ha! You've triggered me to put my own PHP multi-layered neural network on
GitHub. Available for forks & downloads here:
<https://github.com/infostreams/neural-network>

------
lingbing
ok whats the point? what can i train with this? what kind of outputs can i
get?

