Disclaimer:
These pages about different languages / apis / best practices were mostly jotted down quckily and rarely corrected afterwards.
The languages / apis / best practices may have changed over time (e.g. the facebook api being a prime example), so what was documented as a good way to do something at the time might be outdated when you read it (some pages here are over 15 years old).
Just as a reminder.

Machine Learning

K-means clustering

Clustering intro
How to find how many clusters (if you don know what you want)
No easy way to get it.

You might know in advance, e.g. cluster by digits 0-9 means you want 10 clusters.

Could run algorithm for differnt values of K, K=2,3,...
And compare variance (how many are in each cluster?), and pick the one with the smallest variance.
Problem: is ideal when K=n (i.e. one in each cluster)
In general, the more clusters you add, the lower the variance is going to be.


Look at it visually in scree plot. Pick the K where the mountain ends and the rubble begins, i.e. less drastic changes:
maximize 2nd derivate of V: point where rate of decline changes the most.
Mean-shift
Mean-shift, can be used to track objects between frames

Neural networks

Google Tech Talks - November, 29 2007
How convolutional neural networks see the world
Training and investigating Residual Nets
Neural networks for computer vision
The Back Propagation Algorithm
A Beginner's Guide To Understanding Convolutional Neural Networks
Trained image classification models for Keras
Neural Network Architectures

Tools

scikit-learn: Machine Learning in Python
scikit tutorial
PyHubs is a machine learning library developed in Python. It contains implementations of hubness-aware machine learning algorithms together with some useful tools for machine learning experiments.
Curated list of machine learning frameworks, libraries and software

Tensorflow

TensorFlow
http://playground.tensorflow.org/
K-Means Clustering with TensorFlow
Improvement on that K-means example
Other k-means implmenetation
Tensorflow sample code
TensorFlow Implementation of Deep Convolutional Generative Adversarial Networks
CS224D Lecture 7 - Introduction to TensorFlow (19th Apr 2016)
https://github.com/aymericdamien/TensorFlow-Examples
RNNS IN TENSORFLOW, A PRACTICAL GUIDE AND UNDOCUMENTED FEATURES

Videos/Lectures

Caltech machine learning 2012
Microsoft Research: Deep Learning 7 December 2015
Deep Learning course by Google
Neural Networks Demystified
Lecture
Lecture python numpy
cs231n Andrej Karpathy 2016
UC Berkeley CS188 Intro to AI
cs189
cs294-112 berkeley deeplearning

t-SNE

Visualizing data using t-SNE
http://scikit-learn.org/stable/auto_examples/manifold/plot_lle_digits.html

word2vec and similar

Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by Simon Hughes, Dice.com (Oct 2015)
http://multithreaded.stitchfix.com/blog/2015/03/11/word-is-worth-a-thousand-vectors/
http://eng.kifi.com/from-word2vec-to-doc2vec-an-approach-driven-by-chinese-restaurant-process/
https://github.com/dav/word2vec
This is an implementation of the LexVec word embedding model (similar to word2vec and GloVe) that achieves state of the art results in multiple NLP tasks

Clustering

Fuzzy k-means in python
Fuzzifying clustering algorithms: The case study of MajorClust
http://pythonhosted.org/scikit-fuzzy/auto_examples/plot_cmeans.html
http://stackoverflow.com/questions/6736347/is-a-fuzzy-c-means-algorithm-available-for-python
https://pypi.python.org/pypi/scikit-fuzzy
Joint Unsupervised Learning of Deep Representations and Image Clusters (2016)
https://github.com/jwyang/joint-unsupervised-learning

Image classification

https://github.com/jcjohnson/densecap
alternative to opencv, looks good, c++

Face detection

https://github.com/cmusatyalab/openface
https://bamos.github.io/2016/01/19/openface-0.2.0/
Where are they looking?

NLP

https://github.com/oxford-cs-deepnlp-2017/lectures
cs224n NLP 2017
Python NLP package

General

Tensortalk, just links to AI stuff in a hackernews/reddit manner
Understanding Aesthetics with Deep Learning
Netflix: extracting interesting regions/text, how they define simularity
Starting points for deep learning and RNN
https://github.com/kjw0612/awesome-rnn
Approaching (Almost) Any Machine Learning Problem (2016)
DeepWarp: Photorealistic Image Resynthesis for Gaze Manipulation (in ECCV'16)
http://www.efimov-ml.com
https://blog.insightdatascience.com/graph-based-machine-learning-6e2bd8926a0
http://news.efinancialcareers.com/uk-en/285249/machine-learning-and-big-data-j-p-morgan/

General AI books

Second machine age

Fooling networks

http://www.evolvingai.org/fooling

Theano

Intro to Deep Learning with Theano and OpenDeep by Markus Beissinger (2015)

Pytorch

http://blog.outcome.io/pytorch-quick-start-classifying-an-image/

Nearest neigbhor packages

Overview of theory and pros/cons of some packages
https://github.com/lyst/rpforest
https://github.com/spotify/annoy
http://www.cs.ubc.ca/research/flann/
https://github.com/primetang/pyflann
https://github.com/mariusmuja/flann
https://github.com/falconn-lib/falconn
https://github.com/yahoo/lopq
http://www.kgraph.org/index.php?n=Main.Home
https://github.com/hdidx/hdidx
http://mmp2.github.io/megaman/
https://arxiv.org/pdf/1603.02763.pdf
https://github.com/kayzhu/LSHash
http://ryanrhymes.github.io/panns/
Installing cunn:  
luarocks install cunn

libcunnx.so malformed object
http://stackoverflow.com/questions/26822010/install-name-tool-malformed-object-load-command-23-cmdsize-is-zero-mac-os-x
   
   th -e "require 'cutorch'; print(cutorch)"
   luajit -l libcutorch
   problem loading torch/install/lib/lua/5.1/libcutorch.so:
   https://github.com/torch/cutorch/issues/243
  http://stackoverflow.com/questions/36312018/unable-to-import-require-cutorch-in-torch
  http://ubuntuforums.org/showthread.php?t=2264359
  https://github.com/torch/cutorch/issues/244
  https://github.com/torch/cutorch/issues/126
   

Keras

Check if using gpu

from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
   https://tryolabs.com/blog/2013/03/25/why-accuracy-alone-bad-measure-classification-tasks-and-what-we-can-do-about-it/

  
   accuracy = "how high percentage of data set did it get right"
   precision = "how relevant was the result returned, i.e. were there false positives"
   recall = "how high percentage of the relevant result did it return, ignore any false positives"
   

   
    Accuracy = (true positives + true negatives) / (total examples)
    Precision = (true positives) / (true positives + false positives)
    Recall = (true positives) / (true positives + false negatives)
    F1 score = (2 * precision * recall) / (precision + recall)

   Misclassification Rate = (FP + FN) / total

   (microsoft definition)
   TPR = TP / (TP + FP)
   FPR = FN / (TN + FN)


   For multi classification:

   Accuracy = (TP + TN) / (TP + TN + FP + FN)
   where TN is defined as "all items that should have been classified in all other classes MINUS False Positives")

   Precision (micro) = sum(all TP) / (sum(all TP) + sum(all TN))
   Precision (macro) = sum(precision for each class) / numclasses

   F1 micro/macro in the same way


----------------------------------------------------------------------

  
OS X
    cd /lib
    export DYLD_LIBRARY_PATH=`pwd`:$DYLD_LIBRARY_PATH
    Add  to your build and link process by adding -I/include to your compile line and -L/lib -lcudnn to your link line.


Find out version of cuda:
nvcc --version
Find out version of cudnn:
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
Find which cuda match with which cudnn
https://developer.nvidia.com/rdp/cudnn-download


  
Pytorch

Copy the lib + include files to/usr/local/cuda/


       If it cmake complains about path to wrong xcode, check for
       CMakeCache.txt
       in the project and delete those


       
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
export CUDNN_LIB_DIR=/usr/local/cuda
export CUDNN_LIBRARY=/usr/local/cuda/lib/libcudnn.dylib
export CUDNN_INCLUDE_DIR=/usr/local/cuda/include
export LD_LIBRARY_PATH=/usr/local/cuda/lib/

       pytorch
       https://github.com/pytorch/pytorch#from-source

MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install


Verify installation
import torch
t = torch.rand(3)
t

 0.8304
 0.0331
 0.7206
[torch.FloatTensor of size 3]

r = t.cuda()
>>> r

 0.8304
 0.0331
 0.7206
[torch.cuda.FloatTensor of size 3 (GPU 0)]


  

More programming related pages

Workflow: Release process
Workflow: Bug tracking
Teambox (Redbooth) - Mantis connector
Design Patterns
Git & Github
Go / Golang
CVS
CVS backup script
Distribution process
Installation script
Java Server Faces
Facelets
jibx
jBoss
jBpm
Perl tips
Perl links
PostgreSQL
Python / py2app
Shell scripts
Xslt
Node.js
Facebook / Opengraph
PHP developer notes
Redbooth API through php
Website optimization
jqTableKit demo
Javascript / html / css links