1. A method for source separation based on determining a number of bases for a nonnegative matrix factorization (NMF) model, the method comprising: receiving, at a computing device, a mixed signal including a combination of first signal data and second signal data; generating, by the computing device, a time-frequency representation of the mixed signal; determining, by applying a structured stochastic variational inference (SSVI) algorithm to the NMF model, a number of bases for a dictionary of signal-related components of the mixed signal, wherein applying the SSVI algorithm comprises varying the number of bases within a range and selecting the number of bases from the range based on training data; constructing, using the number of bases and the time-frequency representation, the dictionary and an activation matrix of weights, the weights indicating how active each one of the signal-related components is at a given time; and separating, using the dictionary and the activation matrix, the first signal data from the second signal data.