candle.keras_utils.build_initializer

candle.keras_utils.build_initializer#

candle.keras_utils.build_initializer(initializer, kerasDefaults, seed=None, constant=0.0)#

Set the initializer to the appropriate Keras initializer function based on the input string and learning rate. Other required values are set to the Keras default values.

Parameters:
  • initializer (string) – String to choose the initializer Options recognized: ‘constant’, ‘uniform’, ‘normal’, ‘glorot_uniform’, ‘lecun_uniform’, ‘he_normal’ See the Keras documentation for a full description of the options

  • kerasDefaults (Dict) – Dictionary of default parameter values to ensure consistency between frameworks

  • seed (int) – Random number seed

  • constant (float) – Constant value (for the constant initializer only)

Returns:

The appropriate Keras initializer function