5.0
5.0 | 2 ratings Rate this file 22 Downloads (last 30 days) File Size: 6.28 KB File ID: #38109
image thumbnail

Simple to use NMF/NTF with beta divergence

by

 

10 Sep 2012 (Updated )

very simple to use implementation of the NMF/NTF model

| Watch this File

File Information
Description

function [W,H,Q, Vhat] = betaNTF(V,K,varargin)
%------------------------------------------------------------------
% simple beta-NTF implementation
%
% Decomposes a tensor V of dimension FxTxI into a NTF model :
% V(f,t,i) = \sum_k W(f,k)H(t,k)Q(i,k)
%
% by minimizing a beta-divergence as a cost-functions.
% particular cases include :
% * beta = 2 : Euclidean cost function
% * beta = 1 : Kullback-Leibler costfunction
% * beta = 0 : Itakura-Saito cost function
%
% caution:
% The third dimension of V ought to be the smallest. permute
% your data to this purpose if needed.
%
%
% It is possible to weight the cost function by a weight factor P of
% the same size as V, and to fix some of the components for W, H,
% and Q
%
% inputs :
% * V : FxTxI non-negative data to approximate
% * K : number of NTF components
%
% * Optional arguments include :
% - W : FxKw spectral basis
% - H : TxKh temporal activations
% - Q : IxKq loading factors
%
% Note the if Kw,Kh or Kq < K, they are completed with random init.
%
% - P : FxTxI weighting matrix, permits to weight the cost function
% to optimize element-wise
% - fixedW : the first fixedW components of W are fixed (default=0)
% - fixedH : the first fixedH components of H are fixed (default=0)
% - fixedQ : the first fixedQ components of Q are fixed (default=0)
% - nIter : number of iterations, default=100
% - beta : beta divergence considered, default=0 (Itakura-Saito)
% - display : display plots during optimization (default=0)
%
%
% outputs
% * W,H,Q : NTF model parameters
% * Vhat : reconstruction
%
% Example :
% [W,H,Q, Vhat] = betaNTF(V,'W',myW,'fixedW',1)
%
% Reconstruct your data using:
% for j = 1:I, Vhat(:,:,j) = W * diag(Q(j,:)) * H'; end
%--------------------------------------------------------------------------
% Antoine Liutkus, Inria, 2015

MATLAB release MATLAB 7.8 (R2009a)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
13 Feb 2015 Supachan Traitruengsakul  
29 May 2014 Lucas Nogueira

Thanks for sharing it!

Updates
11 Sep 2012

modified slightly description to add some important details

12 Nov 2012

Modified a function description.

11 Mar 2015

Added the possibility to fixe only some of the components in W, H or Q

11 Mar 2015

corrected the description

22 Mar 2015

Had mismatched the title of this submission

Contact us