seperate rbm structure and learning