Locally implementable learning with isospectral matrix flows