Distributed Learning over Networks under Subspace Constraints