module can now deal with nan values for nonexisting relative states in case all relative states are nan, the latent representation is zeroed, which is consitent with an empty sum