Motif Finding with Gibbs Sampling (F#)

The Problem "Motif finding is a problem of finding common substrings of specified length in a set of strings. In bioinformatics, this is useful for finding transcription binding sites" (recap here). The problem is succinctly stated on Rosalind. Given a set of strings DNA of size t, find "most common" substrings of length k. "Most common" means, that substrings … Continue reading Motif Finding with Gibbs Sampling (F#)

Modelling Stochastically Independent Processes with F# Computation Expressions: Part 2

Code for this entry: here. In this first part, we started shamelessly plagiarizing creatively reproducing a Clojure monad that does a great job describing stochastically independent processes. After a few trials I became convinced, that the approach in the blog post mentioned above was indeed optimal: a "natural" approach of modelling an event as a … Continue reading Modelling Stochastically Independent Processes with F# Computation Expressions: Part 2

Modelling Stochastically Independent Processes with F# Computation Expressions: Part 1

The idea for doing this is not new. There is an excellent series of posts closely tracing an article on applications of functional programming to probability. A colleague of mine has recently called my attention to his own post of two years ago, where he describes a monad that models stochastically independent events in Clojure. … Continue reading Modelling Stochastically Independent Processes with F# Computation Expressions: Part 1

Supercharging SQL Join with GTX Titan, CUDA C++, and Thrust: Part 2

Note: All this code is now on GitHub. Compute the mathces Here is a simple, purely brute-force algorithm for computing the join mentioned in Part 1. Here is the entirely "CPU" implementation of the algorithm: Loop over both datasets, compare them one-by-one, if there is a match - flag it. The only thing to note … Continue reading Supercharging SQL Join with GTX Titan, CUDA C++, and Thrust: Part 2

Supercharging SQL Join with GTX Titan, CUDA C++, and Thrust: Part 1

This is a post in two parts: Part 1 - The problem, solution setup, the algorithm. Part 2 - (The juicy) Implementation details, discussion. Suppose at the heart of the data layer of a web application there is a join like this: This join filters patents belonging to a set of classes from the Patents … Continue reading Supercharging SQL Join with GTX Titan, CUDA C++, and Thrust: Part 1

Compiling CUDA Projects with Dynamic Parallelism (VS 2012/13)

Just a quick note. If you are starting from a template C++ CUDA project in VS 2012/2013, calling a kernel from a kernel (dynamic parallelism) would not compile: error : kernel launch from __device__ or __global__ functions requires separate compilation mode To fix this, first make sure your hardware supports it (cc 3.5 or higher) … Continue reading Compiling CUDA Projects with Dynamic Parallelism (VS 2012/13)