Training Neural Networks for Likelihood/Density Ratio Estimation