Skip to content

lvdmaaten/metriclearning

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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