Papers › Constrained non-negative matrix factorization enabling real-time insights of in situ...

Constrained non-negative matrix factorization enabling real-time insights of in situ and high-throughput experiments

2 Apr 2021arXiv:2104.00864archive 2025-07-28

Phillip M. Maffettone, Aidan C. Daly, Daniel Olds

Non-negative Matrix Factorization (NMF) methods offer an appealing unsupervised learning method for real-time analysis of streaming spectral data in time-sensitive data collection, such as in situ characterization of materials. However, canonical NMF methods are optimized to reconstruct a full dataset as closely as possible, with no underlying requirement that the reconstruction produces components or weights representative of the true physical processes. In this work, we demonstrate how constraining NMF weights or components, provided as known or assumed priors, can provide significant improvement in revealing true underlying phenomena. We present a PyTorch based method for efficiently applying constrained NMF and demonstrate this on several synthetic examples. When applied to streaming experimentally measured spectral data, an expert researcher-in-the-loop can provide and dynamically adjust the constraints. This set of interactive priors to the NMF model can, for example, contain known or identified independent components, as well as functional expectations about the mixing of components. We demonstrate this application on measured X-ray diffraction and pair distribution function data from in situ beamline experiments. Details of the method are described, and general guidance provided to employ constrained NMF in extraction of critical information and insights during in situ and high-throughput experiments.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2104.00864")

Code

Syntology Ran 5 of 21 code samples harvested from 2 repositories linked to this paper; 16 have no recorded run. Of those that ran: 4 ran · violated contract; 1 ran · our draft was wrong.

By repository: community (archive-listed): 21 samples from 2 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

NSLS-II/constrained-matrix-factorization mentioned on GitHubpytorchBSD-3-Clause report
bnl/pub-Maffettone_2021_04 mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

21 samples harvested; 5 ran; 0 honoured the contract we drafted; 16 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · violated contract
1ran · our draft was wrong
16unverified

Licence: 0 of the 21 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

construct_overlap bnl/pub-Maffettone_2021_04/constrainednmf/example_scripts/simulation_constraining_weights.py community (archive-listed) ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) · e30b629762e9c5ce · report
gaussian bnl/pub-Maffettone_2021_04/constrainednmf/example_scripts/simulation_constraining_weights.py community (archive-listed) ran · violated contract fingerprinted BSD-3-Clause (permissive) · bfb5a3349111c442 · report
gaussian bnl/pub-Maffettone_2021_04/constrainednmf/example_scripts/simulation_constraining_components.py community (archive-listed) ran · violated contract fingerprinted BSD-3-Clause (permissive) · dc85e687f1fe54a1 · report
lorentzian bnl/pub-Maffettone_2021_04/constrainednmf/example_scripts/simulation_constraining_components.py community (archive-listed) ran · violated contract fingerprinted BSD-3-Clause (permissive) · 4059f8d130c75434 · report
tophat bnl/pub-Maffettone_2021_04/constrainednmf/example_scripts/simulation_constraining_components.py community (archive-listed) ran · violated contract fingerprinted BSD-3-Clause (permissive) · ac3311fb78cb42ee · report
Euclidean NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/metrics.py community (archive-listed) unverified BSD-3-Clause (permissive) · b4d4a9741a95cdcc · report
IS_divergence NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/metrics.py community (archive-listed) unverified BSD-3-Clause (permissive) · dcb5e69a1cca5494 · report
KL_divergence NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/metrics.py community (archive-listed) unverified BSD-3-Clause (permissive) · 103628a541cf7a84 · report
construct_overlap NSLS-II/constrained-matrix-factorization/example_scripts/fixing_weights.py community (archive-listed) unverified BSD-3-Clause (permissive) · 6b745b4e35321043 · report
decomp_plot NSLS-II/constrained-matrix-factorization/constrainedmf/utils/plotting.py community (archive-listed) unverified BSD-3-Clause (permissive) · efc799ee1501e75a · report
get_config_from_root NSLS-II/constrained-matrix-factorization/versioneer.py community (archive-listed) unverified BSD-3-Clause (permissive) · 7a63797a121e8bbf · report
get_data NSLS-II/constrained-matrix-factorization/example_scripts/bto.py community (archive-listed) unverified BSD-3-Clause (permissive) · 72940734b1f5958e · report
get_data NSLS-II/constrained-matrix-factorization/example_scripts/molten_salt.py community (archive-listed) unverified BSD-3-Clause (permissive) · d93ac8414c5d548c · report
normalize NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · 4513b2bb026b89d2 · report
register_vcs_handler NSLS-II/constrained-matrix-factorization/versioneer.py community (archive-listed) unverified BSD-3-Clause (permissive) · f12f4dabbeb242eb · report
run_command NSLS-II/constrained-matrix-factorization/versioneer.py community (archive-listed) unverified BSD-3-Clause (permissive) · 86d4ff45d6295e29 · report
scalar_to_vec NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · c2191e9366151532 · report
sweep_components NSLS-II/constrained-matrix-factorization/constrainedmf/nmf/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · d28ebfacd8fd4cd1 · report
toy_plot NSLS-II/constrained-matrix-factorization/constrainedmf/utils/plotting.py community (archive-listed) unverified BSD-3-Clause (permissive) · 38c0f458a2b3424c · report
versions_from_parentdir NSLS-II/constrained-matrix-factorization/constrainedmf/_version.py community (archive-listed) unverified BSD-3-Clause (permissive) · b9a1535d27f2a9fb · report
waterfall NSLS-II/constrained-matrix-factorization/constrainedmf/utils/plotting.py community (archive-listed) unverified BSD-3-Clause (permissive) · 37b5fda319bf3c0a · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections