added a check condition on the DBN preTrain method to look for trip conditions when the layers may not be initialized