docstr: Set a value for a parameter
  
  kwargs: (param_name, value) - parameter to initialize.
  Can also initialize recursively by passing in the full name of a
  parameter. For example if model has attribute model.likelihood,
  we can initialize the noise with either
  `model.initialize(**{'likelihood.noise': 0.1})`
  or
  `model.likelihood.initialize(noise=0.1)`.
  The former method would allow users to more easily store the
  initialization values as one object.
  
  Value can take the form of a tensor, a float, or an int
code: def initialize(self, **kwargs):
      """
      Set a value for a parameter
  
      kwargs: (param_name, value) - parameter to initialize.
      Can also initialize recursively by passing in the full name of a
      parameter. For example if model has attribute model.likelihood,
      we can initialize the noise with either
      `model.initialize(**{'likelihood.noise': 0.1})`
      or
      `model.likelihood.initialize(noise=0.1)`.
      The former method would allow users to more easily store the
      initialization values as one object.
  
      Value can take the form of a tensor, a float, or an int
      """
      for name, value in kwargs.items():
          if not torch.is_tensor(value):
              raise RuntimeError(
                  "Initialize in RandomModules can only be done with tensor values."
              )
  
          names = name.rsplit(".")
          if len(names) > 1:
              mod_name, param_name = names
              mod = operator.attrgetter(mod_name)(self)
          else:
              mod, param_name = self, name
  
          old_param = getattr(mod, param_name)
          is_property = hasattr(type(self), name) and isinstance(
              getattr(type(self), name), property
          )
          if (
              not isinstance(old_param, torch.nn.Parameter)
              or is_property
          ):
              # Presumably we're calling a getter that will call initialize again on the actual parameter.
              setattr(mod, param_name, value.expand(old_param.shape))
          else:
              delattr(mod, param_name)
              setattr(mod, param_name, value.expand(old_param.shape))
  
      return self
  
imports: import copy
  import inspect
  import itertools
  import operator
  from collections import OrderedDict
  from typing import Union
  import torch
  from linear_operator.operators import LinearOperator
  from torch import nn, Tensor
  from torch.distributions import Distribution
  from .constraints import Interval
label_desc: Use image node_id 1 for calling the RandomModuleMixin obj's underlying member method code with example usage: obj.initialize() and returns: self