Representation learning in distributed networks