Vectorize All the Things: Multiply-Add

The rise of Machine Learning is bringing the fashion for numerical tricks and hardware acceleration back. And now that I’ve completed my bacterial DNA counting adventures at ETHZ, it’s time to reboot this blog. As someone who believes in mechanical sympathy I’d like to share some of the experiments in vectorizing simple-yet-fundamental operations. And if you have some insights how to beat the benchmarks below, I’d gladly accept them and extend the list.

How to Name a Cat

A fun conversation about mountains, monads, types and heels reminded me about the first University years and one of our favourite math jokes. Here’s an attempt to translate it (original): Btw, Basis is a good name for a cat. Yeah, imposing… “Basis, come here”. “Yes… Basis is full… Look at our complete Basis.” “Basis, shoo from the bed! Where is your space?” “C’mon, convert to normal!” “Basis, we’ll measure you!

Keywords Mix

I got recently caught up with the paper work and came accross some fun notes from years ago! Couldn’t wait to share this contextual keywords mix, the courtesy of @v2_matveev: 1 2 3 4 5 6 7 partial class where<partial> where partial: where<partial> { dynamic dynamic<yield>(dynamic dynamic) { return dynamic<yield>(dynamic); } } Yes, it compiles :)

Traditions vs Statistics: Sechseläuten

What do you expect from this summer? Should you worry about 20:39 or not? Sunglasses or umbrella? Let’s find out! 1 Traditions Each country has its own fun traditions and festivals, and Switzerland is not an exception. One of the most exciting events is the spring festival, Sechseläuten, which is celebrated in Zürich in April. And it’s also a day when you realize, that there’re some people in town except the tourists walking along the Bahnhofstrasse on Saturdays!

Reshaping Arrays in .NET

Reshape is one of these little functions, which look so simple and straightforward that you don’t think much about them. It’s quite useful and, I’m pretty sure, familiar to everyone who’s written something in a language like Matlab. However, in other languages it might become a bit tricky. Question I asked a bunch of people how they would write reshape in a .NET language. That’s not really a problem when you know the exact type and dimensionality, e.