# Kohonen Learning Procedure K-Means vs Lloyd's K-means

K-means maybe the most common data quantization method, used widely for many different domain of problems. Even it relies on very simple idea, it proposes satisfying results in a computationally efficient environment.

Underneath of the formula of K-means optimization, the objective is to minimize the distance between data points to its closest centroid (cluster center). Here we can write the objective as;

$argmin sum_{i=1}^{k}sum_{x_j in S_i} ||x_j - mu_i||^2$

$mu_i$ is the closest centroid to instance $x_j$.

# Setting up cudamat in Ubuntu Machine

cudamat is a python library that makes you available to use CUDA benefits from Python instead of intricate low level approaches. This interface uses also

Before follow these steps please make sure that you installed a working CUDA library.

3. Set the environment variables to include cudamat in PYTHONPATH to be able to imported by any script. Run followings in the command line.
 PYTHONPATH=\$PYTHONPATH:/path/to/cudamat
export PYTHONPATH
4. You are ready to use cudamat.

Here is a simple code you might test;

 # -*- coding: utf-8 -*-
import numpy as np
import cudamat as cm
cm.cublas_init()
# create two random matrices and copy them to the GPU
a = cm.CUDAMatrix(np.random.rand(32, 256))
b = cm.CUDAMatrix(np.random.rand(256, 32))
# perform calculations on the GPU
c = cm.dot(a, b)
d = c.sum(axis = 0)
# copy d back to the host (CPU) and print
print d.asarray()



Note: If you get any other path problem, it would be related to CUDA installation therefore check environment parameters need to be set for CUDA.

# Solution to Steam lunch problem in linux

If you installed Steam to your linux machine and see some lunch alerts complaining about such error;

You are missing the following 32-bit libraries, and Steam may not run: libGL.so.1

this is your solution time. Here is the solution.

This seem to happen on every 64bits OS. Full bug report here:

https://github.com/ValveSoftware/steam-for-linux/issues/321

# Best Android ROMs that I experienced

For a long time, I have yet to find best ROM variant to my galaxy s2. I used so many different names with different benefits. Battery life, smoothness, loading performance and such qualifications are general expectations of a user but I know that it is really killing to find all of those constraints in one ROM. One might give good performance whereas it drains your battery in a hour, on the other experience, one might gives best battery juice with varying error messages you see in a day. I also come along that way and here is my list of best ROMs with specific pros and cons.

# Paranoid ROM

This ROM based on well known CynogenMod with very different and Continue reading Best Android ROMs that I experienced

# Some web apps that changes the way of internet usage and develop.

Last days I've discovered some web apps that amaze me and I think that they are big candidates to change the internet's usage.

First one, ifttt.com:

IFTTT (entitled by the shorthand of "If This Than That")give you the chance of automate all the chain reaction you face while using internet. You might create some rules by using some common web apps . For example, IF a specific user from twitter twit something out THAN append his twit to a file in my Dropbox account. Continue reading Some web apps that changes the way of internet usage and develop.

# Disable Facebook Timeline (Chrome Extension)

I am not a facebook user but I heard a lot about the ones who don't want to use timeline. I also have not used this extension but It says it disables the timeline. You may try with your luck .

Here the extension