rewrite vanilla sigm nn