# Displaying the Mask from NMF

**URL:** https://discourse.flucoma.org/t/displaying-the-mask-from-nmf/683
**Category:** Code Sharing
**Created:** [October 23, 2020, 2:06pm UTC](https://discourse.flucoma.org/t/displaying-the-mask-from-nmf/683 "2020-10-23T14:06:59Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![a.harker](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/a.harker/32/18_2.png) [@a.harker](https://discourse.flucoma.org/u/a.harker)
#### Post date: [October 24, 2020, 2:35pm UTC](https://discourse.flucoma.org/t/displaying-the-mask-from-nmf/683/8 "2020-10-24T14:35:23Z")

</div>

I think you aren’t quite following me - I said 0-1 and NOT 0/1, so yes this is a soft mask, but it is a mask, not a magnitude (which is what you calculate in the vocoder and also in your patch) - you require a normalisation step after the magnitude which you talk about and I’ve included in my code, but you haven’t in either the vocoder or the patch you posted - the outer product which doesn’t do that step. BTW - you can also save a step in your patch by using .jit.buffer~ to read the buffers directly into matrices.

I’ve just actually checked the source (as I’ve just been working conceptually) and basically what I am doing is the work of RatioMask, except that I generate the output magnitudes by summing activations \* bases for all components, which I assume is equivalent to the way they are generated internally, but that’s bit more complex.

I understand what you are saying about the cross product, but I’m simply doing it manually - it’s not complicated enough to need a library function, and unless they’ve optimised that in some way (which is unknown) it won’t be faster algorithmically than manual loops.

---

_[View the full topic](https://discourse.flucoma.org/t/displaying-the-mask-from-nmf/683)._
