Dragan Djuric
117 FOLLOWERS
This blog is a place where Dragan Djuric writes about his journey of trying to make Clojure a great environment for high-performance numerical computing, GPU computing, Bayesian data analysis, and probabilistic machine learning.
Dragan Djuric
2w ago
I've applied for Clojurists Together funding to explore and hopefully implement a Neanderthal Apple silicon backend. If you are a Clojurists Together member, and you think that this functionality is important, please have that in mind when voting. Here's the proposal that I've sent. Of course, any suggestions are welcome and highly appreciated!
The proposal
My goal with this funding in 2025 is to support Apple silicon (M cpus) in Neanderthal (and other Uncomplicate libraries where that makes sense and where it's possible).
This will hugely streamline user experience regarding high performance ..read more
Dragan Djuric
2y ago
I've been busy in the last period working on new major features in Deep Diamond, one of which is the support for Recurrent Neural Networks (RNN). It's not been an easy ride, but I can finally show you some results! Big thanks for everyone that's helping me with this by buying my books (or subscribing to the upcoming editions), and Clojurists Together, who generously funded me in the past year to work on this.
I know that most of you probably don't have much more than passing familiarity with deep learning, let alone recurrent neural networks, and that's why I'll try to show a very simple examp ..read more
Dragan Djuric
2y ago
In the last article we created a receiver function that listened to signals from our foot controller and started or stopped playback on consecutive clicks. The trouble with our player it that it only works until the end of the track. The start! function does not automatically rewind the playback. Neither stop! does that. Our program is responsible for detecting that the track should be rewound, perhaps by detecting that we reached the end of track (but even that is not fool proof, since audio infrastructure is not that precise). Now we have to think about a foot user interface that is useful a ..read more
Dragan Djuric
2y ago
In the last article we managed to connect a MIDI controller and receive updates whenever something happens to its knobs and buttons. So what? As it is, nothing. Printing out messages is not of much use, beyond perhaps getting informed about how these messages look like, and what kind of data they typically contain. On another thought, exactly that is often valuable, because how else can we debug what's happening and learn how to use these devices. They typically don't come with terrific manuals.
Luckily, basic use revolves around receiving one of a few kind of standard messages, that typically ..read more
Dragan Djuric
2y ago
You may not know that music instrument were connected devices even in the Stone Age, that is, many decades ago. In the 80's that even resulted in the standard that facilitated connectivity of heterogeneous devices. Typically, you'd have a keyboard, a synthesizer, some external knobs, maybe effect boxes, and many of them could be connected by cable and talk to each other, even though that synth might be 27 years old, and the keyboard 2 years old.
That's the power of standard. MIDI might not be technically impressive. Especially for 2022, its transfer rate is unbelievably slow. On the other hand ..read more
Dragan Djuric
2y ago
In case you haven't heard about Clojurists Together yet, you might be surprised to hear that there's such awesome initiative that funds critical Clojure open source software. You've never heard of Clojure? Now I don't believe you! A programmer that hasn't at least heard of this awesome practical and yet elegant programming language? Huh. OK.
Yet, a language that is not that awesome wouldn't attract such an enthusiastic people, who recognized the problem of funding work on open source software (they wouldn't be the first), and did something about it. They created Clojurists Together, a non-prof ..read more
Dragan Djuric
2y ago
You might not be too thrilled with the sound richness of the default piano that played Maple Leaf Rag in the previous article. We can use a much better one, of course! Here we broaden our understanding of the basic building blocks that generate music in Clojure Sound]](): sequencers, synthesizers, and instruments.
If you followed along by trying out the code in your favorite Clojure REPL tool, you can continue hacking on the same project.
The namespaces
We use the same namespaces as before: clojure-sound 's core and midi, and a couple general functions from uncomplicate commons library.
(re ..read more
Dragan Djuric
2y ago
I've just noticed that it's been one year since the last post on this blog. It's not because I've been lazy. I had just finished two books (check them out!) and I probably suffered a bit from the writer's exhaustion afterwards. I'm joking. I wasn't that exhausted; I've been busy with programming. Thanks to generous support from Clojurists Together, and thanks to people who bought or subscribed to my books, I've been able to take on some bigger chunks of time to work on Uncomplicate libraries, old and new. OK, enough talking; you're not here to read my reports, but to see some nice Clojure code ..read more
Dragan Djuric
3y ago
Let's start right in the middle of the story, and play with cosine similarity. I'll tell you why in a few minutes.
I assume that most programmers have forgotten their math classes, so "cosine similarity" sounds somewhat grandiose. Quick skimming at Wikipedia might puzzle you even more, but, scrolling down to the definition, you can see that it's just a normalized dot product. I know, I know - now you might wonder what dot product really is. Please read my recent linear algebra Hello World article if that's the case.
A little warm up coding
We are programmers; it will all be clear after we cod ..read more
Dragan Djuric
3y ago
Recent popularity of Machine Learning brought high performance computing on the radar of most programming. You've heard that math in general and linear algebra in particular is central in implementing and using this stuff. However, you might have a hard time connecting the linear algebra that you've learned in college (and probably forgot by now) to actual programming tasks where you'd use it now.
I hope that a simple Hello World example can at least give you a rough idea of how LA can be applied in programming. I won't dwell on the theory; let's see whether we can make this intuitive.
Just an ..read more