This Julia repo implements a variety of Nonnegative Matrix Factorization (NMF) models in Julia, a fast, flexible and free programming language. NMF attempts to solve the optimization problem
minimize D(X || W H) s.t. W >= 0, H >= 0
where D(X || W H)
is some distance metric between X
and W H
.
Fitting an NMF model is easy. Simply choose your algorithm and any relevant hyperparemeters. For example,
>> using NonnegMatrixFactor
>> results = fit_nmf(data, alg=:mult, K=3, max_itr=100)
>>
>> using Plots
>> plot(results.time_hist, results.loss_hist)
First, download and install the latest version of Julia. Then install the NonnegMatrixFactor
package:
>> using Pkg
>> Pkg.add("NonnegMatrixFactor")
The following NMF models and algorithms are available
- Frobenius norm loss (square error)
- Multiplicative updates (
alg=:mult
) - Hierachical alternating least squares (
alg=:hals
) - Projected alternaing least squares (
alg=:projals
)
- Multiplicative updates (
- KL-divergence loss
- Multiplicative updates (
alg=:kl_mult
)
- Multiplicative updates (