Implicit affinity networks code