LayeredRBM as base class for implementation of DBNs