def __init__(self, layers, batch_size=None, input_space=None,
                 input_source='features', target_source='targets',
                 nvis=None, seed=None, layer_name=None, monitor_targets=True,
                 **kwargs):
        super(MLP, self).__init__(**kwargs)

        self.seed = seed

        assert isinstance(layers, list)
        assert all(isinstance(layer, Layer) for layer in layers)
        assert len(layers) >= 1

        self.layer_name = layer_name

        self.layer_names = set()
        for layer in layers:
            assert layer.get_mlp() is None
            if layer.layer_name in self.layer_names:
                raise ValueError("MLP.__init__ given two or more layers "
                                 "with same name: " + layer.layer_name)

            layer.set_mlp(self)

            self.layer_names.add(layer.layer_name)

        self.layers = layers

        self.batch_size = batch_size
        self.force_batch_size = batch_size

        self._input_source = input_source
        self._target_source = target_source

        self.monitor_targets = monitor_targets

        if input_space is not None or nvis is not None:
            self._nested = False
            self.setup_rng()

            # check if the layer_name is None (the MLP is the outer MLP)
            assert layer_name is None

            if nvis is not None:
                input_space = VectorSpace(nvis)

            # Check whether the input_space and input_source structures match
            try:
                DataSpecsMapping((input_space, input_source))
            except __HOLE__:
                raise ValueError("The structures of `input_space`, %s, and "
                                 "`input_source`, %s do not match. If you "
                                 "specified a CompositeSpace as an input, "
                                 "be sure to specify the data sources as well."
                                 % (input_space, input_source))

            self.input_space = input_space

            self._update_layer_input_spaces()
        else:
            self._nested = True

        self.freeze_set = set([])
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/mlp.py/MLP.__init__