Torch package for metric learning.
Lua
Latest commit 6d429b8 May 28, 2016 @lvdmaaten fix bug in LMNN code
Permalink
Failed to load latest commit information.
demos add ITML Jan 2, 2015
README.md fix bug in LMNN code May 28, 2016
init.lua add ITML Jan 2, 2015
itml.lua add ITML Jan 2, 2015
lmnn.lua fix bug in LMNN code May 28, 2016
metriclearning-scm-0.rockspec add ITML Jan 2, 2015
nca.lua update nca demo Dec 5, 2014

README.md

Metric learning

This package contains Torch7 implementations of metric learning algorithms.

Install

Installation of the package can be performed via:

luarocks install metriclearning

Use

Below is a simple example of the usage of the package:

-- package:
m = require 'metriclearning'

-- a dataset:
X = torch.randn(100, 10) -- 100 samples, 10-dim each
Y = X:select(2, 1):gt(0):long()
Y[Y:eq(0)] = -1  -- corresponding labels

-- learn Mahalanobis metric using LMNN:
M = m.lmnn(X, Y)

Demos

The following demos are currently provided:

cd demos
th demo_nca.lua
th demo_lmnn.lua
th demo_itml.lua