Weakly supervised learning of acoustic units