On the loss landscape of a class of deep neural networks with no bad local valleys