fixed the SCG optimizer, thanks to Yarin Gal