class_docstr: Applies initializers to the parameters of a Module based on regex matches.  Any parameter not
  explicitly matching a regex will not be initialized, instead using whatever the default
  initialization was in the module's code.
docstr: Converts a Params object into an InitializerApplicator. The json should
  be formatted as follows::
  
      [
          ["parameter_regex_match1",
              {
                  "type": "normal"
                  "mean": 0.01
                  "std": 0.1
              }
          ],
          ["parameter_regex_match2", "uniform"]
          ["prevent_init_regex", "prevent"]
      ]
  
  where the first item in each tuple is the regex that matches to parameters, and the second
  item is a set of parameters that will be passed to ``Initialzer.from_params()``.  These
  values can either be strings, in which case they correspond to the names of initializers,
  or dictionaries, in which case they must contain the "type" key, corresponding to the name
  of an initializer.  In addition, they may contain auxiliary named parameters which will be
  fed to the initializer itself. To determine valid auxiliary parameters, please refer to the
  torch.nn.init documentation. Only "prevent" is a special type which does not have corresponding
  initializer. Any parameter matching its corresponding regex will be overriden to NOT initialize.
  
  Returns
  -------
  An InitializerApplicator containing the specified initializers.
docstr_tok: ["Converts","a","Params","object","into","an","InitializerApplicator",".","The","json","should","be","formatted","as","follows",":",":","[","[","``","parameter_regex_match1","''",",","{","``","type","''",":","``","normal","''","``","mean","''",":","0.01","``","std","''",":","0.1","}","]",",","[","``","parameter_regex_match2","''",",","``","uniform","''","]","[","``","prevent_init_regex","''",",","``","prevent","''","]","]","where","the","first","item","in","each","tuple","is","the","regex","that","matches","to","parameters",",","and","the","second","item","is","a","set","of","parameters","that","will","be","passed","to","``","Initialzer.from_params","(",")","``",".","These","values","can","either","be","strings",",","in","which","case","they","correspond","to","the","names","of","initializers",",","or","dictionaries",",","in","which","case","they","must","contain","the","``","type","''","key",",","corresponding","to","the","name","of","an","initializer",".","In","addition",",","they","may","contain","auxiliary","named","parameters","which","will","be","fed","to","the","initializer","itself",".","To","determine","valid","auxiliary","parameters",",","please","refer","to","the","torch.nn.init","documentation",".","Only","``","prevent","''","is","a","special","type","which","does","not","have","corresponding","initializer",".","Any","parameter","matching","its","corresponding","regex","will","be","overriden","to","NOT","initialize",".","Returns","--","--","--","-","An","InitializerApplicator","containing","the","specified","initializers","."]
code: def from_params(cls, params=()):  # type: ignore
      """
      Converts a Params object into an InitializerApplicator. The json should
      be formatted as follows::
  
          [
              ["parameter_regex_match1",
                  {
                      "type": "normal"
                      "mean": 0.01
                      "std": 0.1
                  }
              ],
              ["parameter_regex_match2", "uniform"]
              ["prevent_init_regex", "prevent"]
          ]
  
      where the first item in each tuple is the regex that matches to parameters, and the second
      item is a set of parameters that will be passed to ``Initialzer.from_params()``.  These
      values can either be strings, in which case they correspond to the names of initializers,
      or dictionaries, in which case they must contain the "type" key, corresponding to the name
      of an initializer.  In addition, they may contain auxiliary named parameters which will be
      fed to the initializer itself. To determine valid auxiliary parameters, please refer to the
      torch.nn.init documentation. Only "prevent" is a special type which does not have corresponding
      initializer. Any parameter matching its corresponding regex will be overriden to NOT initialize.
  
      Returns
      -------
      An InitializerApplicator containing the specified initializers.
      """
      # pylint: disable=arguments-differ
  
      is_prevent = lambda item: item == "prevent" or item == {
          "type": "prevent"
      }
      prevent_regexes = [
          param[0] for param in params if is_prevent(param[1])
      ]
      params = [
          param
          for param in params
          if param[1]
          if not is_prevent(param[1])
      ]
      initializers = [
          (name, Initializer.from_params(init_params))
          for name, init_params in params
      ]
      return InitializerApplicator(initializers, prevent_regexes)
  
imports: from __future__ import division
  from __future__ import absolute_import
  import logging
  import re
  import math
  import itertools
  import torch
  import torch.nn.init
  from allennlp.common import Registrable
  from allennlp.common.params import Params
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 3 for calling the InitializerApplicator obj's underlying member method code with example usage: obj.from_params(cls, params) and returns: InitializerApplicator