docs: public static Pair<WeightInit, Distribution> mapWeightInitialization(String kerasInit,
                                                                           KerasLayerConfiguration conf,
                                                                           Map<String, Object> initConfig,
                                                                           int kerasMajorVersion)
              throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException {
  
  
          // TODO: Identity and VarianceScaling need "scale" factor
          WeightInit init = null;
          Distribution dist = null;
          if (kerasInit != null) {
              if (kerasInit.equals(conf.getINIT_GLOROT_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_GLOROT_NORMAL_ALIAS())) {
                  init = WeightInit.XAVIER;
              } else if (kerasInit.equals(conf.getINIT_GLOROT_UNIFORM()) ||
                      kerasInit.equals(conf.getINIT_GLOROT_UNIFORM_ALIAS())) {
                  init = WeightInit.XAVIER_UNIFORM;
              } else if (kerasInit.equals(conf.getINIT_LECUN_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_LECUN_NORMAL_ALIAS())) {
                  init = WeightInit.LECUN_NORMAL;
              } else if (kerasInit.equals(conf.getINIT_LECUN_UNIFORM()) ||
                      kerasInit.equals(conf.getINIT_LECUN_UNIFORM_ALIAS())) {
                  init = WeightInit.LECUN_UNIFORM;
              } else if (kerasInit.equals(conf.getINIT_HE_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_HE_NORMAL_ALIAS())) {
                  init = WeightInit.RELU;
              } else if (kerasInit.equals(conf.getINIT_HE_UNIFORM()) ||
                      kerasInit.equals(conf.getINIT_HE_UNIFORM_ALIAS())) {
                  init = WeightInit.RELU_UNIFORM;
              } else if (kerasInit.equals(conf.getINIT_ONE()) ||
                      kerasInit.equals(conf.getINIT_ONES()) ||
                      kerasInit.equals(conf.getINIT_ONES_ALIAS())) {
                  init = WeightInit.ONES;
              } else if (kerasInit.equals(conf.getINIT_ZERO()) ||
                      kerasInit.equals(conf.getINIT_ZEROS()) ||
                      kerasInit.equals(conf.getINIT_ZEROS_ALIAS())) {
                  init = WeightInit.ZERO;
              } else if (kerasInit.equals(conf.getINIT_UNIFORM()) ||
                      kerasInit.equals(conf.getINIT_RANDOM_UNIFORM()) ||
                      kerasInit.equals(conf.getINIT_RANDOM_UNIFORM_ALIAS())) {
                  if (kerasMajorVersion == 2) {
                      double minVal = (double) initConfig.get(conf.getLAYER_FIELD_INIT_MINVAL());
                      double maxVal = (double) initConfig.get(conf.getLAYER_FIELD_INIT_MAXVAL());
                      dist = new UniformDistribution(minVal, maxVal);
                  } else {
                      double scale = 0.05;
                      if (initConfig.containsKey(conf.getLAYER_FIELD_INIT_SCALE()))
                          scale = (double) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                      dist = new UniformDistribution(-scale, scale);
                  }
                  init = WeightInit.DISTRIBUTION;
              } else if (kerasInit.equals(conf.getINIT_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_RANDOM_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_RANDOM_NORMAL_ALIAS())) {
                  if (kerasMajorVersion == 2) {
                      double mean = (double) initConfig.get(conf.getLAYER_FIELD_INIT_MEAN());
                      double stdDev = (double) initConfig.get(conf.getLAYER_FIELD_INIT_STDDEV());
                      dist = new NormalDistribution(mean, stdDev);
                  } else {
                      double scale = 0.05;
                      if (initConfig.containsKey(conf.getLAYER_FIELD_INIT_SCALE()))
                          scale = (double) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                      dist = new NormalDistribution(0, scale);
                  }
                  init = WeightInit.DISTRIBUTION;
              } else if (kerasInit.equals(conf.getINIT_CONSTANT()) ||
                      kerasInit.equals(conf.getINIT_CONSTANT_ALIAS())) {
                  double value = (double) initConfig.get(conf.getLAYER_FIELD_INIT_VALUE());
                  dist = new ConstantDistribution(value);
                  init = WeightInit.DISTRIBUTION;
              } else if (kerasInit.equals(conf.getINIT_ORTHOGONAL()) ||
                      kerasInit.equals(conf.getINIT_ORTHOGONAL_ALIAS())) {
                  if (kerasMajorVersion == 2) {
                      double gain;
                      try {
                          gain = (double) initConfig.get(conf.getLAYER_FIELD_INIT_GAIN());
                      } catch (Exception e) {
                          gain = (int) initConfig.get(conf.getLAYER_FIELD_INIT_GAIN());
                      }
                      dist = new OrthogonalDistribution(gain);
                  } else {
                      double scale = 1.1;
                      if (initConfig.containsKey(conf.getLAYER_FIELD_INIT_SCALE()))
                          scale = (double) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                      dist = new OrthogonalDistribution(scale);
                  }
                  init = WeightInit.DISTRIBUTION;
              } else if (kerasInit.equals(conf.getINIT_TRUNCATED_NORMAL()) ||
                      kerasInit.equals(conf.getINIT_TRUNCATED_NORMAL_ALIAS())) {
                  double mean = (double) initConfig.get(conf.getLAYER_FIELD_INIT_MEAN());
                  double stdDev = (double) initConfig.get(conf.getLAYER_FIELD_INIT_STDDEV());
                  dist = new TruncatedNormalDistribution(mean, stdDev);
                  init = WeightInit.DISTRIBUTION;
              } else if (kerasInit.equals(conf.getINIT_IDENTITY()) ||
                      kerasInit.equals(conf.getINIT_IDENTITY_ALIAS())) {
                  if (kerasMajorVersion == 2) {
                      double gain = (double) initConfig.get(conf.getLAYER_FIELD_INIT_GAIN());
                      if (gain != 1.)
                          log.warn("Scaled identity weight init not supported, setting gain=1");
                  } else {
                      double scale = 1.;
                      if (initConfig.containsKey(conf.getLAYER_FIELD_INIT_SCALE()))
                          scale = (double) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                      if (scale != 1.)
                          log.warn("Scaled identity weight init not supported, setting scale=1");
                  }
                  init = WeightInit.IDENTITY;
              } else if (kerasInit.equals(conf.getINIT_VARIANCE_SCALING())) {
                  double scale;
                  try {
                      scale = (double) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                  } catch (Exception e) {
                      scale = (int) initConfig.get(conf.getLAYER_FIELD_INIT_SCALE());
                  }
                  if (scale != 1.)
                      log.warn("Scaled identity weight init not supported, setting scale=1");
                  String mode = (String) initConfig.get(conf.getLAYER_FIELD_INIT_MODE());
                  String distribution = (String) initConfig.get(conf.getLAYER_FIELD_INIT_DISTRIBUTION());
                  switch (mode) {
                      case "fan_in":
                          if (distribution.equals("normal")) {
                              init = WeightInit.VAR_SCALING_NORMAL_FAN_IN;
                          } else {
                              init = WeightInit.VAR_SCALING_UNIFORM_FAN_IN;
                          }
                          break;
                      case "fan_out":
                          if (distribution.equals("normal")) {
                              init = WeightInit.VAR_SCALING_NORMAL_FAN_OUT;
                          } else {
                              init = WeightInit.VAR_SCALING_UNIFORM_FAN_OUT;
                          }
                          break;
                      case "fan_avg":
                          if (distribution.equals("normal")) {
                              init = WeightInit.VAR_SCALING_NORMAL_FAN_AVG;
                          } else {
                              init = WeightInit.VAR_SCALING_UNIFORM_FAN_AVG;
                          }
                          break;
                      default:
                          throw new InvalidKerasConfigurationException("Initialization argument 'mode' has to be either " +
                                  "fan_in, fan_out or fan_avg");
                  }
              } else {
                  throw new UnsupportedKerasConfigurationException("Unknown keras weight initializer " + kerasInit);
              }
          }
          return new Pair<>(init, dist);
      }