Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PG-NMF performance is terrible #2537

Closed
Closed
@larsmans

Description

@larsmans

There's a benchmark script in benchmarks/bench_plot_nmf.py that compares our implementation Lin's projected gradient algorithm against Lee & Seung's old gradient descent algorithm, which it implements in 20 lines of code. Turns out that the PG algorithm is completely incapable of beating that baseline, regardless of initialization and despite all the recent optimizations to it. In fact, the baseline is typically faster by a significant margin.

One problem with ProjectedGradientNMF is that its default tolerance is much too small. When I set the tolerance in the benchmark to a lower value, PG-NMF comes closer to the baseline and can beat it some of the time, but often enough the baseline is still faster than the fastest PG-NMF run.

(I'd have included the plot here, but it seems to be broken and doesn't display the Lee/Seung algorithm's timings.)

I've already tried rewriting the PG algorithm in Cython, leaving only the dot products to Python. That shaves off about a quarter of the running time of fit_transform, not enough to make it really fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions