Skip to content

Conversation

@tremblap
Copy link
Member

@tremblap tremblap commented Nov 25, 2025

first attempt at a first UT in c++... this should work, but my test is from the hip... I'm not certain I test the right thing at the right dims

@tremblap tremblap requested a review from weefuzzy November 25, 2025 19:13

using fluid::algorithm::NMFCross;
using Tensor = fluid::FluidTensor<double, 2>;
NMFCross algo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NMFCross algo;
NMFCross algo(2);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the algo is created at each call, with the number of iterations as a constructor variable?

Tensor targetMag{{0.5, 0.4}, {0.1, 1.1}, {0.7, 0.8}, {0.3, 0.0}, {1.0, 0.9}, {0.2, 0.6}};
Tensor sourceMag{{0.0, 0.4}, {0.6, 0.7}, {0.8, 0.1}, {1.0, 0.5}, {1.1, 0.2}, {0.9, 0.3}};

std::vector Hs(3, Tensor(5, 2));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::vector Hs(3, Tensor(5, 2));
std::vector Hs(3, Tensor(6, 6));

Algo is getting numFrames from the length of targetMag and the rank from the length of sourceMag

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With those changes, the tests pass for me. Locally, rerun cmake with -DFLUCOMA_TESTS=ON to enable

@weefuzzy weefuzzy assigned weefuzzy and tremblap and unassigned weefuzzy Nov 25, 2025
@weefuzzy weefuzzy added the enhancement New feature or request label Nov 25, 2025
@tremblap tremblap changed the title first attempt at a first UT in c++ NMFCross seeding random Nov 27, 2025
@tremblap tremblap merged commit f908d0f into flucoma:main Dec 5, 2025
3 checks passed
@tremblap tremblap mentioned this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants