docs: def _initialize(self):
          """
          Initialize model and layers.
          """
          meta = getattr(self, ModelBase._meta_attr)
          # read modelfile, convert JSON and load/update model
          if self.param_file is not None:
              self._load()
          LOGGER.debug('model:\n%r', self.model)
          # initialize layers
          # FIXME: move import inside loop for custom layers in different modules
          mod = importlib.import_module(meta.layers_mod, meta.layers_pkg)
          src_model = {}
          for layer, value in self.model.iteritems():
              # from layers module get the layer's class definition
              layer_cls = getattr(mod, meta.layer_cls_names[layer])  # class def
              self.layers[layer] = layer_cls  # add layer class def to model
              # check if model layers are classes
              src_value = {}  # layer value generated from source classes
              for src in value['sources']:
                  # check if source has keyword arguments
                  try:
                      src, kwargs = src
                  except (TypeError, ValueError):
                      kwargs = {}  # no key work arguments
                  # skip if not a source class
                  if isinstance(src, basestring):
                      continue
                  # generate layer value from source class
                  src_value[src.__name__] = {'module': src.__module__,
                                             'package': None}
                  # update layer keyword arguments
                  src_value[src.__name__].update(kwargs)
              # use layer values generated from source class
              if src_value:
                  value = src_model[layer] = src_value
              else:
                  srcmod, srcpkg = value.get('module'), value.get('package')
                  try:
                      value = dict(value['sources'])
                  except ValueError:
                      value = dict.fromkeys(value['sources'], {})
                  for src in value.viewkeys():
                      if srcmod is not None:
                          value[src]['module'] = srcmod
                      if srcpkg is not None:
                          value[src]['package'] = srcpkg
              # set layer attribute with model data
              setattr(self, layer, layer_cls(value))
          # update model with layer values generated from source classes
          if src_model:
              self.model.update(src_model)
          self._update()
          self._state = 'initialized'