implement negative sampling and random discard