# Passing cv::Mat as argument

Often times when we pass cv::Mat, we forget one important thing: OpenCV matrix does not respect the const modifier. In this post I would like to discuss what happens when cv::Mat is passed around.

# Hungarian Algorithm

## Problem Statement

The problem of the assignment is fairly straight-forward. To describe it, let us consider several examples

• There are $n$ workers and $n$ tasks. You know exactly how much you need to pay each worker to perform one or another task. You also know that every worker can only perform one task. Your goal is to assign each worker some a task, while minimizing your expenses.
• Given matrix $M$ of size $n\times n$, you need to select one element per row and column, such that the sum of all selected cells is minimized.
• Given a matrix $M$ of size $n\times n$, find permutation $p$ of length $n$, such taht $\sum{A[i][p[i]]}$ is minimized
• Given a complete bipartite graph with $n$ vertices with every edge having some weight. Find perfect matching for the graph with minimum weight.

Note: All the problems above assume a “square matrix”, that is $n\times n$ dimensions. In practice this is rarely the case, and the dimensions are $n\times m, n\neq m$. In this case the goal is to match $\min{n, m}$ vertices.

Note: The minimization problem above could be converted to maximization problem by multiplying all weights by $-1$.

We use machine learning almost everywhere now, and a lot of research is focused on improving the accuracy, improving the time it takes us to train the networks, improving the complexity, etc… I would like to contribute a little to a slightly different problem: how would we improve test time figures of merit?

Suppose you are controlling a robot using a machine learning algorithm, and would like to increase its battery life. If you don’t care about the training time, but test-time accuracy is important, but not as important as your battery life – how would you go about it?

We have recently released a work on hardware of the adaptive classifiers, but I wanted to give a more “people-friendly” explanation here

You can download the iPython Notebook that I used to generate the images here.

Image source: not_notMNIST GitHub

# not_notMNIST Dataset Generation

If you have ever worked with classification algorithms, you are definitely familiar with the MNIST dataset. If you are a little more involved with machine learning and especially classification, you have heard of the notMNIST as well.

However, if you always wanted to have your own dataset, but didn’t know how to use it – this post is for you!

Image source: TensorFlow

# Contributing to TensorFlow Community

Installing the TensorFlow (TF) is fairly well documented in the official documentation, however, when I was rewriting some of the parts, I had to get both the Stable and the Developer versions. In here I will go through TensorFlow installation for both versions in the VirtualEnv.