online learning of interaction matrix