'Load the model.
Any parameter which has one of the strings inside parameter_strings_to_ignore as a substring,
will not be loaded from the file (but instead initialized as a new model, which usually means random).'

def load(self, filename, parameter_strings_to_ignore=[]):

    vals = numpy.load(filename)
    for p in self.params:
        load_parameter = True
        for string_to_ignore in parameter_strings_to_ignore:
            if (string_to_ignore in p.name):
                logger.debug('Initializing    parameter    {}    as    in    new    model'.format(p.name))
                load_parameter = False
        if load_parameter:
            if (p.name in vals):
                logger.debug('Loading    {}    of    {}'.format(p.name, p.get_value(borrow=True).shape))
                if (p.get_value().shape != vals[p.name].shape):
                    raise Exception('Shape    mismatch:    {}    !=    {}    for    {}'.format(p.get_value().shape, vals[p.name].shape, p.name))
                p.set_value(vals[p.name])
            else:
                logger.error('No    parameter    {}    given:    default    initialization    used'.format(p.name))
                unknown = (set(vals.keys()) - {p.name for p in self.params})
                if len(unknown):
                    logger.error('Unknown    parameters    {}    given'.format(unknown))
