November 04, 2017 @ 15:29
I haven't updated my blog for a while because there hasn't been much to say.
I considered writing an article about what I had learned about making neural networks and robots.
But you know, the internet doesn't need another half-baked tutorial. If you want that, go and check out
/r/programming
.
In saying that, if you are interested in what I've been up to, here's some progress notes.
When I was working at a startup I was doing a lot of machine learning, and wasn't satisfied with just using various kinds of networks and not knowing how neural networks worked. So, I made a neural network without using a framework of any kind.
Unfortunately this was my first project using C++, or any statically-typed language, and I didn't understand the importance of dependency injection for keeping things modular. So it's become hard to maintain or extend.
Because of the modularity issue, it doesn't have many unit tests. It does have lots of integration tests, so that helps (but not ideal).
My plan is to serialise the results of training the network into a JSON file so I can use the networks after training them, once I've wrangled the code into something more sustainable. Overall I've learned a lot so it definitely was not a failure.
It's been a really interesting project and has meant I made a fully functioning backpropagation engine, which required me to learn the maths.
It was in tents (whenever anyone says intense, I imagine someone working furiously in a tent).
When I say weaponised, I mean it's capable of firing a small projectile at a cat or some other easy target that just happens to be in my lounge room.
It's basically a robot that gets around on four legs, much like half a spider. So it's only half as scary; or half as cute (see this if you don't think spiders are cute).
Also, the robot has to run on batteries so having eight legs, each with several servos, just wasn't going to work.
The project has these constraints:
I'm no engineer (although some programmers call themselves that) and this has been fun to figure out. Because of the requirements to run this thing on a battery, I'm using the following:
For the project I'm using WiringPi, because it takes care of communicating with the servos. Doing this yourself would require you to think about threading. That's because servo motors need to receive signals for a time duration, so you'd need at least a thread for every servo.
A great addition would be to add a voice recognition engine... because if you're going to have a robot spider running Arch Linux that fires missiles at unsuspecting house pets, you might as well make it voice activated so it can do your evil bidding.
Designing the legs and body of the robot was particularly fun and I've put the designs in the linked repo if you want some prints. They're written in OpenSCAD and you can just print the stl files actually.
I meet other programmers who assume I'm some kind of hipster because I use a Linux distro and Vim. Really, when someone with a beard and a fidget spinner says you're a hipster, that's an issue.
The comments/misconceptions seem to be two varieties:
Vim can't do all the stuff an IDE does
- Wrong though, because if you need extras you can set
up a better .vimrc
. Here's
mine. If you still
need more, use TMux or something. Why do you do things the hard way?
. I mean, I wouldn't use Vim unless I thought it was easy
and productive. I don't make remarks about people who insist on learning to use difficult and
bulky GUIs, and don't understand why people do this, but that's what you like so GOOD FOR YOU.The suspicion I have about C# developers who say this stuff is they have a form of Stockholm Syndrome, but I would too if I was held captive by an IDE with no opportunity to use anything else. You'd need to deal with that I guess.
It's all a bit silly, and it's strange even talking about it. There's no chorus of people who mock others for using Visual Studio or Sublime, etc.
It's as simple as this: I use Visual Studio at work because I code in C# and .NET. I have tried Rider and others. I still prefer Vim. It's just personal preference.