def get_weight_param(hparams, param_name, default_value=1.0):
  """Returns params dict for a parameter value based on what is set in hparams.

  Args:
    hparams: configDict.
    param_name: str; Name of the weight parameter.
    default_value: float; Value used if not set.
  """
  default_params = {
      'initial_value': hparams.get(param_name, default_value),
      'mode': 'constant'
  }
  params = hparams.get(param_name + '_params', default_params)

  return params