The returned result is a linear decomposition into activation and components. We can go the other way using the dot product of these two.
import librosa
import numpy
import sklearn.decomposition
filename = librosa.util.example_audio_file()
y, sr = librosa.load(filename)
y = y[:20000] # smaller file, make it go faster
# abs() is not invertible, can replace with minmax scaling
S = numpy.abs(librosa.stft(y))
transformer = sklearn.decomposition.NMF(n_components=32)
W, H = librosa.decompose.decompose(S, transformer=transformer)
S_recomposed = W.dot(H)
print(numpy.sum(numpy.abs(S - S_recomposed)))
Note that the recomposition will never be perfect. But it should get better as n_components
increases.