40ec35876d38c4797ad3ee9bf911b019faa5a61d,allennlp/nn/initializers.py,InitializerApplicator,__call__,#InitializerApplicator#Any#,149

Before Change


                    logger.info("Initializing %s using %s intitializer", name, initializer_regex)
                    is_initialized = True
                    break
            if not is_initialized:
                not_explicitly_initialized_parameters.append((name, parameter))

        logger.info("Initializing remaining parameters with default initializer: %s",
                    self._default_initializer)
        for name, parameter in not_explicitly_initialized_parameters:
            if any(re.search(exclude_regex, name) for exclude_regex in self._exclude):

After Change


        uninitialized_parameters = set()
        // Store which initialisers were applied to which parameters.
        for name, parameter in module.named_parameters():
            for initializer_regex, initializer in self._initializers:
                if re.search(initializer_regex, name):
                    logger.info("Initializing %s using %s intitializer", name, initializer_regex)
                    initializer(parameter)
                    unused_regexes.discard(initializer_regex)
                    break
            else:  // no break
                uninitialized_parameters.add(name)
        for regex in unused_regexes:
            logger.warning("Did not use initialization regex that was passed: %s", regex)
        logger.info("Done initializing parameters; the following parameters are using their "
                    "default initialization from their code")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: allenai/allennlp
Commit Name: 40ec35876d38c4797ad3ee9bf911b019faa5a61d
Time: 2017-08-25
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: __call__


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: c9e7c3ffaba09850ddcd90b88528028fbbde22d6
Time: 2016-04-20
Author: skschneider@users.noreply.github.com
File Name: perfkitbenchmarker/flag_util.py
Class Name: UnitsParser
Method Name: Parse


Project Name: tensorlayer/tensorlayer
Commit Name: 16a31e2c9fedc654e9117b42b8144adf1d0e4900
Time: 2020-02-03
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_TRPO.py
Class Name: TRPO
Method Name: update