code: public static Pair<WeightInit, Distribution> getWeightInitFromConfig(Map<String, Object> layerConfig, String initField,
                                                                           boolean enforceTrainingConfig,
                                                                           KerasLayerConfiguration conf,
                                                                           int kerasMajorVersion)
              throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
          Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
          if (!innerConfig.containsKey(initField))
              throw new InvalidKerasConfigurationException("Keras layer is missing " + initField + " field");
          String kerasInit;
          Map<String, Object> initMap;
          if (kerasMajorVersion != 2) {
              kerasInit = (String) innerConfig.get(initField);
              initMap = innerConfig;
          } else {
              @SuppressWarnings("unchecked")
              Map<String, Object> fullInitMap = (HashMap) innerConfig.get(initField);
              initMap = (HashMap) fullInitMap.get("config");
              if (fullInitMap.containsKey("class_name")) {
                  kerasInit = (String) fullInitMap.get("class_name");
              } else {
                  throw new UnsupportedKerasConfigurationException("Incomplete initialization class");
              }
          }
          Pair<WeightInit, Distribution> init;
          try {
              init = mapWeightInitialization(kerasInit, conf, initMap, kerasMajorVersion);
          } catch (UnsupportedKerasConfigurationException e) {
              if (enforceTrainingConfig)
                  throw e;
              else {
                  init = new Pair<>(WeightInit.XAVIER, null);
                  log.warn("Unknown weight initializer " + kerasInit + " (Using XAVIER instead).");
              }
          }
          return init;
      }
docs: Get weight initialization from Keras layer configuration.
  
  @param layerConfig           dictionary containing Keras layer configuration
  @param enforceTrainingConfig whether to enforce loading configuration for further training
  @return Pair of DL4J weight initialization and distribution
  @throws InvalidKerasConfigurationException     Invalid Keras config
  @throws UnsupportedKerasConfigurationException Unsupported Keras config