Bug in trainingBP: segfault of only 1 layer