Skip to content

lvdmaaten/metriclearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

(The demos require the unsup package: luarocks install unsup)

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

About

Torch package for metric learning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages