fixes in dbn, base and rbm