當前位置: 首頁>>代碼示例>>Java>>正文


Java Config.getDouble方法代碼示例

本文整理匯總了Java中com.typesafe.config.Config.getDouble方法的典型用法代碼示例。如果您正苦於以下問題:Java Config.getDouble方法的具體用法?Java Config.getDouble怎麽用?Java Config.getDouble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.typesafe.config.Config的用法示例。


在下文中一共展示了Config.getDouble方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ALSUpdate

import com.typesafe.config.Config; //導入方法依賴的package包/類
public ALSUpdate(Config config) {
  super(config);
  iterations = config.getInt("oryx.als.iterations");
  implicit = config.getBoolean("oryx.als.implicit");
  logStrength = config.getBoolean("oryx.als.logStrength");
  Preconditions.checkArgument(iterations > 0);
  hyperParamValues = new ArrayList<>(Arrays.asList(
      HyperParams.fromConfig(config, "oryx.als.hyperparams.features"),
      HyperParams.fromConfig(config, "oryx.als.hyperparams.lambda"),
      HyperParams.fromConfig(config, "oryx.als.hyperparams.alpha")));
  if (logStrength) {
    hyperParamValues.add(HyperParams.fromConfig(config, "oryx.als.hyperparams.epsilon"));
  }
  noKnownItems = config.getBoolean("oryx.als.no-known-items");
  decayFactor = config.getDouble("oryx.als.decay.factor");
  decayZeroThreshold = config.getDouble("oryx.als.decay.zero-threshold");
  Preconditions.checkArgument(iterations > 0);
  Preconditions.checkArgument(decayFactor > 0.0 && decayFactor <= 1.0);
  Preconditions.checkArgument(decayZeroThreshold >= 0.0);
}
 
開發者ID:oncewang,項目名稱:oryx2,代碼行數:21,代碼來源:ALSUpdate.java

示例2: MLUpdate

import com.typesafe.config.Config; //導入方法依賴的package包/類
protected MLUpdate(Config config) {
  this.testFraction = config.getDouble("oryx.ml.eval.test-fraction");
  int candidates = config.getInt("oryx.ml.eval.candidates");
  this.evalParallelism = config.getInt("oryx.ml.eval.parallelism");
  this.threshold = ConfigUtils.getOptionalDouble(config, "oryx.ml.eval.threshold");
  this.maxMessageSize = config.getInt("oryx.update-topic.message.max-size");
  Preconditions.checkArgument(testFraction >= 0.0 && testFraction <= 1.0);
  Preconditions.checkArgument(candidates > 0);
  Preconditions.checkArgument(evalParallelism > 0);
  Preconditions.checkArgument(maxMessageSize > 0);
  if (testFraction == 0.0) {
    if (candidates > 1) {
      log.info("Eval is disabled (test fraction = 0) so candidates is overridden to 1");
      candidates = 1;
    }
  }
  this.candidates = candidates;
  this.hyperParamSearch = config.getString("oryx.ml.eval.hyperparam-search");
}
 
開發者ID:oncewang,項目名稱:oryx2,代碼行數:20,代碼來源:MLUpdate.java

示例3: Hoag

import com.typesafe.config.Config; //導入方法依賴的package包/類
public Hoag(Config config, String prefix) {
    init_step = config.getDouble(prefix + KEY + "init_step");
    step_decr_factor = config.getDouble(prefix + KEY + "step_decr_factor");
    test_loss_reduce_limit = config.getDouble(prefix + KEY + "test_loss_reduce_limit");
    outer_iter = config.getInt(prefix + KEY + "outer_iter");
    List<Double> l1List = config.getDoubleList(prefix + KEY + "l1");
    List<Double> l2List = config.getDoubleList(prefix + KEY + "l2");
    l1 = new double[l1List.size()];
    l2 = new double[l2List.size()];
    for (int i = 0; i < l2.length; i ++) {
        l1[i] = l1List.get(i);
        l2[i] = l2List.get(i);
    }

    CheckUtils.check(step_decr_factor < 1.0, "%sstep_decr_factor:%f must < 1.0",
            prefix + KEY, step_decr_factor);
    CheckUtils.check(l1.length == l2.length,
            "%sl1 lenght must be equal to %sl2 lenght",
            prefix + KEY,
            prefix + KEY);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:22,代碼來源:HyperParams.java

示例4: XConfig

import com.typesafe.config.Config; //導入方法依賴的package包/類
/**
 * Construct a config object using the provided configuration, falling back on the default
 * configuration values <a
 * href="https://github.com/Nordstrom/xrpc/blob/master/src/main/resources/com/nordstrom/xrpc/xrpc.conf">here</a>.
 */
public XConfig(Config configOverrides) {
  Config defaultConfig = ConfigFactory.parseResources(this.getClass(), "xrpc.conf");
  Config config = configOverrides.withFallback(defaultConfig);

  readerIdleTimeout = config.getInt("reader_idle_timeout_seconds");
  writerIdleTimeout = config.getInt("writer_idle_timeout_seconds");
  allIdleTimeout = config.getInt("all_idle_timeout_seconds");
  workerNameFormat = config.getString("worker_name_format");
  bossThreadCount = config.getInt("boss_thread_count");
  workerThreadCount = config.getInt("worker_thread_count");
  maxConnections = config.getInt("max_connections");
  rateLimiterPoolSize = config.getInt("rate_limiter_pool_size");
  softReqPerSec = config.getDouble("soft_req_per_sec");
  hardReqPerSec = config.getDouble("hard_req_per_sec");
  gloablSoftReqPerSec = config.getDouble("global_soft_req_per_sec");
  globalHardReqPerSec = config.getDouble("global_hard_req_per_sec");
  cert = config.getString("cert");
  key = config.getString("key");
  port = config.getInt("server.port");
  slf4jReporter = config.getBoolean("slf4j_reporter");
  jmxReporter = config.getBoolean("jmx_reporter");
  consoleReporter = config.getBoolean("console_reporter");
  slf4jReporterPollingRate = config.getInt("slf4j_reporter_polling_rate");
  consoleReporterPollingRate = config.getInt("console_reporter_polling_rate");

  enableWhiteList = config.getBoolean("enable_white_list");
  enableBlackList = config.getBoolean("enable_black_list");

  ipBlackList =
      ImmutableSet.<String>builder().addAll(config.getStringList("ip_black_list")).build();
  ipWhiteList =
      ImmutableSet.<String>builder().addAll(config.getStringList("ip_white_list")).build();

  populateClientOverrideList(config.getObjectList("req_per_second_override"));
}
 
開發者ID:Nordstrom,項目名稱:xrpc,代碼行數:41,代碼來源:XConfig.java

示例5: ALSServingModelManager

import com.typesafe.config.Config; //導入方法依賴的package包/類
public ALSServingModelManager(Config config) {
  super(config);
  String rescorerProviderClass =
      ConfigUtils.getOptionalString(config, "oryx.als.rescorer-provider-class");
  rescorerProvider = loadRescorerProviders(rescorerProviderClass);
  sampleRate = config.getDouble("oryx.als.sample-rate");
  minModelLoadFraction = config.getDouble("oryx.serving.min-model-load-fraction");
  Preconditions.checkArgument(sampleRate > 0.0 && sampleRate <= 1.0);
  Preconditions.checkArgument(minModelLoadFraction >= 0.0 && minModelLoadFraction <= 1.0);
  logRateLimit = new RateLimitCheck(1, TimeUnit.MINUTES);
}
 
開發者ID:oncewang,項目名稱:oryx2,代碼行數:12,代碼來源:ALSServingModelManager.java

示例6: BackTracking

import com.typesafe.config.Config; //導入方法依賴的package包/類
public BackTracking(Config config, String prefix) {
    step_decr = config.getDouble(prefix + KEY + "step_decr");
    step_incr = config.getDouble(prefix + KEY + "step_incr");
    max_iter = config.getInt(prefix + KEY + "max_iter");
    min_step = config.getDouble(prefix + KEY + "min_step");
    max_step = config.getDouble(prefix + KEY + "max_step");
    c1 = config.getDouble(prefix + KEY + "c1");
    c2 = config.getDouble(prefix + KEY + "c2");

    CheckUtils.check(step_decr < 1.0, "%sstep_decr:%f must < 1.0", prefix + KEY, step_decr);
    CheckUtils.check(step_incr > 1.0, "%sstep_incr:%f must > 1.0", prefix + KEY, step_incr);

    CheckUtils.check(c1 > 0.0 && c1 < 1.0, "%sc1:%f must be in range(0, 1)", prefix + KEY, c1);
    CheckUtils.check(c2 > c1 && c1 < 1.0, "%sc2:%f must be in range(c1, 1)", prefix + KEY, c2);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:16,代碼來源:LineSearchParams.java

示例7: GBMLRDataFlow

import com.typesafe.config.Config; //導入方法依賴的package包/類
public GBMLRDataFlow(IFileSystem fs,
                        Config config,
                        ThreadCommSlave comm,
                        int threadNum,
                        boolean needPyTransform,
                        String pyTransformScript) throws Exception {
    super(fs, config,
            comm,
            threadNum,
            needPyTransform,
            pyTransformScript);

    this.K = config.getInt("k");
    //this.seed = config.getInt("seed");
    this.randomSampleRate = config.getDouble("instance_sample_rate");
    this.randomFeatureRate = config.getDouble("feature_sample_rate");
    this.uniformBaseScore = (float) LossFunctions.createLossFunction(commonParams.lossParams.loss_function).
                            pred2Score(config.getDouble("uniform_base_prediction"));
    this.sampleDepdtBaseScore = config.getBoolean("sample_dependent_base_prediction");
    this.treeNum = config.getInt("tree_num");
    this.learningRate = config.getDouble("learning_rate");
    this.randomParams = new RandomParams(config, "");

    this.type = Type.getType(config.getString("type"));
    if (type == Type.RF) {
        this.learningRate = 1.0;
    }

    CheckUtils.check(K >= 2, "K:%d must >= 2", K);

    LOG_UTILS.importantInfo("K:" + K);
    //comm.LOG_UTILS.importantInfo("seed:" + seed);
    LOG_UTILS.importantInfo("random:" + randomParams);
    LOG_UTILS.importantInfo("instance_sample_rate:" + randomSampleRate);
    LOG_UTILS.importantInfo("feature_sample_rate:" + randomFeatureRate);
    LOG_UTILS.importantInfo("uniform_base_prediction:" + uniformBaseScore);
    LOG_UTILS.importantInfo("tree_num:" + treeNum);
    LOG_UTILS.importantInfo("learning_rate:" + learningRate);
    LOG_UTILS.importantInfo("type:" + type);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:41,代碼來源:GBMLRDataFlow.java

示例8: ALSSpeedModelManager

import com.typesafe.config.Config; //導入方法依賴的package包/類
public ALSSpeedModelManager(Config config) {
  noKnownItems = config.getBoolean("oryx.als.no-known-items");
  minModelLoadFraction = config.getDouble("oryx.speed.min-model-load-fraction");
  Preconditions.checkArgument(minModelLoadFraction >= 0.0 && minModelLoadFraction <= 1.0);
  logRateLimit = new RateLimitCheck(1, TimeUnit.MINUTES);
}
 
開發者ID:oncewang,項目名稱:oryx2,代碼行數:7,代碼來源:ALSSpeedModelManager.java

示例9: Convergence

import com.typesafe.config.Config; //導入方法依賴的package包/類
public Convergence(Config config, String prefix) {
    max_iter = config.getInt(prefix + KEY + "max_iter");
    eps = config.getDouble(prefix + KEY + "eps");
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:5,代碼來源:LineSearchParams.java

示例10: ScaleRange

import com.typesafe.config.Config; //導入方法依賴的package包/類
public ScaleRange(Config config, String prefix) {
    min = config.getDouble(prefix + KEY + "min");
    max = config.getDouble(prefix + KEY + "max");
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:5,代碼來源:TransformParams.java

示例11: Regularization

import com.typesafe.config.Config; //導入方法依賴的package包/類
public Regularization(Config config, String prefix) {
    l1 = config.getDouble(prefix + KEY + "l1");
    l2 = config.getDouble(prefix + KEY + "l2");
    learningRate = (float)config.getDouble(prefix + KEY + "learning_rate");
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:6,代碼來源:GBDTOptimizationParams.java

示例12: Normal

import com.typesafe.config.Config; //導入方法依賴的package包/類
public Normal(Config config, String prefix) {
    mean = config.getDouble(prefix + KEY + "mean");
    std = config.getDouble(prefix + KEY + "std");
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:5,代碼來源:RandomParams.java

示例13: Uniform

import com.typesafe.config.Config; //導入方法依賴的package包/類
public Uniform(Config config, String prefix) {
    range_start = config.getDouble(prefix + KEY + "range_start");
    range_end = config.getDouble(prefix + KEY + "range_end");
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:5,代碼來源:RandomParams.java

示例14: getOptionalDouble

import com.typesafe.config.Config; //導入方法依賴的package包/類
/**
 * @param config configuration to query for value
 * @param key configuration path key
 * @return value for given key, or {@code null} if none exists
 */
public static Double getOptionalDouble(Config config, String key) {
  return config.hasPath(key) ? config.getDouble(key) : null;
}
 
開發者ID:oncewang,項目名稱:oryx2,代碼行數:9,代碼來源:ConfigUtils.java


注:本文中的com.typesafe.config.Config.getDouble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。