fixing train_nn so plotting occurs when speicifed