def add_layers(self, layers):

        # Patch old pickle files
        if not hasattr(self, 'rng'):
            self.setup_rng()

        hidden_layers = self.hidden_layers
        assert len(hidden_layers) > 0
        for layer in layers:
            assert layer.get_dbm() is None
            layer.set_dbm(self)
            layer.set_input_space(hidden_layers[-1].get_output_space())
            hidden_layers.append(layer)
            assert layer.layer_name not in self.layer_names
            self.layer_names.add(layer.layer_name)
Add new layers on top of the existing hidden layers
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/dbm/dbm.py/DBM.add_layers