SAG4CRF: Non-Uniform Stochastic Average Gradient Method for Training Conditional Random Fields

By Mark Schmidt and Mohamed Osama Ahmed (2015)
Last updated 12 Apr 2015.

Summary

The SAG4CRF code contains C implementations (via Matlab mex files) of the non-uniform stochastic average gradient (SAG-NUS*) method, as well as several related methods, for the problem of training chain-structured conditional random field models with L2-regularization.

The SAG-NUS method is decribed in the following paper:

Clicking on the image belows shows a poster giving an overview of this work:



The image below gives the slides for a talk on this work:



The specific methods available in the package are: These methods use a variant of the data format from the crfChain software, and take advantage of sparse operations to allow categorical features with a large number of states.

Download and Examples

To use the code, download and unzip SAG4CRF.zip.

Once this is done, type the following in Matlab:

>> cd SAG4CRF                  % Change to the unzipped directory
>> addpath(genpath(pwd))       % Add all sub-directories to the path
>> mexAll                      % Compile mex files (not necessary on all systems)
>> example_SAG4CRF             % Run/compare all the methods
>> example_SAG4CRF_warmStart   % Shows how to use warm-starting and stopping criterion

Mark Schmidt > Software > SAG