One of the most enjoyable aspects of gaming for me is to try and pretend
I'm the protagonist. That includes making choices the way I'd do them in
real life. Of course, I understand that games are escapism, and I'm not
blaming those that use games as an opportunity to murder pretty much
anything that can be murdered. It's just not my style. I'm more the kind
of gamer that's constantly being chased around by the guards I didn't
kill because they didn't do anything.
Having said that, I'm having trouble with Angry Birds. I know, I
shouldn't expect moral lessons from what is essentially a group of
suicide birds bombing an enemy. But am I the only one who has trouble
with a game that asks you to bomb a playground, including the kids
playing there?
Did you enjoy committing a crime against humanity? Do you need more
genocide? Then good news! You can bomb the skate park, somebody's house,
and even a cemetery. Not only you get to kill your enemies again, but
this time you can get their friends and family too!
Maybe it's because I'm having a bad day. Maybe it's because I'm putting
too much thought into it. Maybe it's because I'm sick and tired of the
phrase "collateral damage", or maybe I'm just missing some black humor.
But in any case, I found out I can't bring myself to finish the game.
I hope that says something nice about me.
So, it's that time of the year again. Apple has unveiled its new
ad-blocking technology for the latest iPhone, and people on the internet
are losing their minds about why ads are good for you, and how this will
be the end of the internet as we know it.
To which I reply: no, they are not. And good riddance. Don't let the
door hit you on your way out.
I can't properly outline the mess that online ads have brought into
internet users. Slower loading times, annoyingly loud sounds, erosion of
our privacy, malware, and constant surveillance of our browsing habits.
"But wait", says the marketer, "if we track you constantly, then we can
sell you better stuff. If ads are tailored to you, then you wouldn't be
annoyed by them - in fact, you would be grateful". To this, I usually
reply by not replying, because arguing with someone who thinks I enjoy
getting sales pitches is a person I don't bother discussing with.
The technical point is more interesting. If the ad industry where to
collapse today, bringing down every ad-supported website along with it,
the resulting meltdown is something I'd love to witness. Imagine the
ad bubble blows up tomorrow. Thousands of websites disappear overnight.
Panic. Chaos. Bloggers on the streets yelling "LIKE ME!" to random
pedestrians. Desperate tweens crying in restaurants because they don't
know what to do with their food pictures. But then we'd all cool down
our collective heads, and realize that most of the stuff we enjoy is
already produced for free, is not supported by ads, or both. Without the
marketers, the internet goes on.
I still remember the "older days" in which advertising was restricted to
a couple pop-ups here and there. And I can tell you: that early internet
was anything but "dead". There was an incredible amount of content long
before the advent of advertising. Which is why I cannot understand how
anyone would believe that the internet needs cash to survive. There was
plenty of content before ads, and there will be plenty of content
afterwards, too
In a following article I'll detail replacements for popular websites and
apps based on technology we already have, to show that ads are more a
convenience than a necessity. But I want to repeat that a volunteer-run
internet would be incredible. Would we lose several of those San
Francisco startups burning cash as fast as they can? Yes. But I'm still
not sure why should I even care. Marketers are free to continue
spreading the notion that they are the saviors of the internet if they
want to. But I'm also free to keep recommending Adblock
Edge and
Disconnect to everyone who wants to enjoy the
internet as it was meant to be.
A final thought: The fact that the side with more money has not
prevailed in this discussion makes me a little less cynical. If their
rooms full of paid commenters have not squashed this discussion yet,
then we must be doing something right.
A couple days ago I found a very interesting article, titled
A
neural network in 11 lines of Python. I always wanted to get a
visualization of how a neural network works, so I took this as my
opportunity. Taking that article as a base, I created a nice visualization
of the simple case, and it ended up looking very nice.
This post is a small version of that. I'm going to show you how a neural
network does its magic, using the magic of Javascript and SVG graphics.
This is the function we'll learn. Implementing XOR
is pretty much the "Hello, World" of neural networks, so we'll be doing the same
here.
Also, note that the third input column is all 1's. This will be our
bias unit (i.e., a column that always equals 1).
Now, let's plug this into our network.
This is a graphical representation of our neural network. The weights
have been randomly initialized (you can check that by reloading the
page). Neurons 0-2 are input, neurons 3-4 are the hidden layer, and
neuron 5 is output. Given that we have 4 training examples, we'll
follow each training example individually.
The computation should proceed as follows: for neuron 3, we'll first
multiply neurons 0-2 by the value of the edge that connects both neurons,
sum those three values, and apply the sigmoid function to the
result. In formal terms, $$n_3 = sigmoid(n_0 w_{0,3} + n_1 w_{1,3} + n_2 w_{2,3})$$
where ni is the i-th neuron, and wi,j
is the weight that connects the neuron wi with the
neuron nj.
The sigmoid function guarantees that
the value for neuron 3 will be a value between 0 and 1. We repeat the same
process for neurons 4 and 5.
So here we can see what our network is actually computing. If
you have not yet read the article to the end, there's a very good chance
that our network is returning random garbage, and that's fine - we haven't
trained it yet, so of course the output makes no sense. This is called
the forward step, in which I test my network and see what it's
being computed.
For the second step, backpropagation, we'll
need to write a couple tables, and see how bad our results are.
Output (expected) | Output (network) | Error |
0 | 0 | 0 | 0 |
0 | 1 | -1 | 0 |
1 | 1 | 0 | 0 |
1 | 0 | 1 | 0 |
Here is an interesting fact. We will call the difference between
the value I expected and the one I actually got the "error" of
the network. Similarly,
sig(x) will represent the sigmoid function, and
sig'(x) will be its derivative. Having defined that,
the following equation $$error*sig'(output)$$
tells me how much should I correct my weights, and in which
direction (whether they should be bigger or smaller).
I won't delve in the math for that now, but if you need more
details there are some links at the end that can help you.
So we have now applied our corrections to the green weights, but how
about the red and blue ones? We'll also correct those by applying a
variation of the same principle: once I corrected the value for the
output, I have to distribute the amount of error into every weight that
contributed to its computation. This will allow me to correct the values
for neurons 3 and 4, which I'll finally use to correct the values for the
remaining weights.
This process is called backpropagation,
because I'm analyzing the network backwards to correct the errors I made
when computing forwards.
Now all that remains for the training process is for me to repeat
these steps over and over, until the er ror (shown underneath) is small
enough.
This is a very simple neural network (although not the simplest),
implemented in Javascript. I've skipped some details in order to make
the whole process simpler - If you want something slightly more
challenging, I definitely suggest you to read
the
original article, which goes into the right level of detail.
I still want to improve on this, but I'm not entirely sure how. I
think it would be nice to see how some neurons are given more (or less)
weight, but I'm not sure how this should look like. If you have any ideas,
feel free to tweet me.
Note: If you are quick enough, you might have noticed that the bias
unit is missing in the hidden layer. The short version is: yes, it is. I only
noticed once it was too late. I'll try and fix it in future revisions of this
article.
Dear Spotify,
I think it's time to realize that you are not the service you once where. At
first it was subtle, like that time when you changed the shade of green of your logo
to the ugly one
you are using now. Then there was that issue with offline mode, in which I lost
a whole playlist because your synchronization with Windows Phone doesn't work.
I guess I should have seen the signals back then.
But now... now you changed. More specifically, you change your Terms of Use,
and I can only use you if I agree for you
to collect my pictures and track my location,
among others. And that's where
I have to draw the line. Spotify, I'm breaking up with you.
Wait, let me rephrase that: I already broke up with you 10 minutes ago, when
I canceled my paid subscription. This is just me being polite.
Let's be honest here: I was not paying for music. I can get free music pretty
much everywhere - call it Youtube, Vimeo, MP3 forums or torrents, finding free
music is not particularly difficult. I was paying those € 10 because I
preferred that to paying with my data, like so many other services. But if you
are going to build a profile of me anyway that is related not to what I like to
listen (which is what you are supposed to care about) but about what I do in my
daily life (which is none of your business), then what's the point? I was paying
to get away of the claws of marketing, and that is now gone. And so am I.
I guess I'll just go back to the old way, building my own music collection
and listening to it wherever and however I want. I may even get back to my old
idea of a streaming server. I know we had our issues before, like when I kept
looking for videogame music and you kept showing me crappy piano versions of
them. Or when you wouldn't change the title of Fabiana Cantilo's misspelled album
even after I pointed it out repeatedly. But this time it's different. This time
I'm gone for good.
Bye, Spotify. I'll show up later on to collect the titles on my playlist, so
I can download them later. You can keep my e-mail address. It was a throwaway
anyway.