本文整理了Java中water.Job.progress()
方法的一些代码示例,展示了Job.progress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.progress()
方法的具体详情如下:
包路径:water.Job
类名称:Job
方法名:progress
[英]Return progress of this job.
[中]返回此作业的进度。
代码示例来源:origin: h2oai/h2o-2
@Override public float progress() {
double d = 0.1;
for( Job job : jobs )
if(job.start_time > 0)
d += job.progress();
return Math.min(1f, (float) (d / jobs.length));
}
代码示例来源:origin: h2oai/h2o-2
/** Return default progress {@link Response}. */
protected Response jobInProgress(final Job job, final Key dst) {
progress = job.progress();
return Response.poll(this, (int) (100 * job.progress()), 100, "job_key", job_key.toString(), "destination_key",
dst.toString());
}
代码示例来源:origin: h2oai/h2o-2
/** Return default progress {@link Response}. */
@Override
protected Response jobInProgress(final Job job, final Key dst) {
progress = job.progress();
return Response.poll(this, (int) (100 * progress), 100, "job_key", job_key.toString(), "destination_key",
destination_key.toString());
}
public static Response redirect(Request req, Key jobkey, Key dest) {
代码示例来源:origin: h2oai/h2o-2
/** Return default progress {@link Response}. */
@Override
protected Response jobInProgress(final Job job, final Key dst) {
progress = job.progress();
return Response.poll(this, (int) (100 * progress), 100, "job_key", job_key.toString(), "destination_key",
destination_key.toString());
}
public static Response redirect(Request req, Key jobkey, Key dest) {
代码示例来源:origin: h2oai/h2o-2
protected void printCrossValidationModelsHTML(StringBuilder sb) {
if (job() == null) return;
Job.ValidatedJob job = (Job.ValidatedJob)job();
if (job.xval_models != null && job.xval_models.length > 0) {
sb.append("<h4>Cross Validation Models</h4>");
sb.append("<table class='table table-bordered table-condensed'>");
sb.append("<tr><th>Model</th></tr>");
for (Key k : job.xval_models) {
Model m = UKV.get(k);
Job j = m != null ? (Job)m.job() : null;
sb.append("<tr>");
sb.append("<td>" + (m != null ? Inspector.link(k.toString(), k.toString()) : "Pending") + (j != null ? ", Progress: " + Utils.formatPct(j.progress()) : "") + "</td>");
sb.append("</tr>");
}
sb.append("</table>");
}
}
代码示例来源:origin: h2oai/h2o-3
private void progressUpdate(Key<Job> job_key, boolean keep_running) {
updateTiming(job_key);
Job job = job_key.get();
double progress = job.progress();
// Log.info("2nd speed: (samples: " + model_info().get_processed_total() + ", total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")");
float speed = (float)(model_info().get_processed_total() * 1000. / (total_training_time_ms -total_scoring_time_ms-total_setup_time_ms));
assert(speed >= 0) : "negative speed computed! (total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")";
String msg =
"Iterations: " + String.format("%,d", iterations)
+ ". Epochs: " + String.format("%g", epoch_counter)
+ ". Speed: " + (speed>10 ? String.format("%d", (int)speed) : String.format("%g", speed)) + " samples/sec."
+ (progress == 0 ? "" : " Estimated time left: " + PrettyPrint.msecs((long) (total_training_time_ms * (1. - progress) / progress), true));
job.update(actual_train_samples_per_iteration,msg); //mark the amount of work done for the progress bar
long now = System.currentTimeMillis();
long sinceLastPrint = now -_timeLastPrintStart;
if (!keep_running || sinceLastPrint > get_params()._score_interval * 1000) { //print this after every score_interval, not considering duty cycle
_timeLastPrintStart = now;
if (!get_params()._quiet_mode) {
Log.info(
"Training time: " + PrettyPrint.msecs(total_training_time_ms, true) + " (scoring: " + PrettyPrint.msecs(total_scoring_time_ms, true) + "). "
+ "Processed " + String.format("%,d", model_info().get_processed_total()) + " samples" + " (" + String.format("%.3f", epoch_counter) + " epochs).\n");
Log.info(msg);
}
}
}
代码示例来源:origin: h2oai/h2o-3
private void progressUpdate(Key<Job> job_key, boolean keep_running) {
updateTiming(job_key);
Job job = job_key.get();
double progress = job.progress();
// Log.info("2nd speed: (samples: " + model_info().get_processed_total() + ", total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")");
int speed = (int)(model_info().get_processed_total() * 1000. / (total_training_time_ms -total_scoring_time_ms-total_setup_time_ms));
assert(speed >= 0) : "negative speed computed! (total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")";
String msg =
"Iterations: " + String.format("%,d", iterations)
+ ". Epochs: " + String.format("%g", epoch_counter)
+ ". Speed: " + String.format("%,d", speed) + " samples/sec."
+ (progress == 0 ? "" : " Estimated time left: " + PrettyPrint.msecs((long) (total_training_time_ms * (1. - progress) / progress), true));
job.update(actual_train_samples_per_iteration,msg); //mark the amount of work done for the progress bar
long now = System.currentTimeMillis();
long sinceLastPrint = now -_timeLastPrintStart;
if (!keep_running || sinceLastPrint > get_params()._score_interval * 1000) { //print this after every score_interval, not considering duty cycle
_timeLastPrintStart = now;
if (!get_params()._quiet_mode) {
Log.info(
"Training time: " + PrettyPrint.msecs(total_training_time_ms, true) + " (scoring: " + PrettyPrint.msecs(total_scoring_time_ms, true) + "). "
+ "Processed " + String.format("%,d", model_info().get_processed_total()) + " samples" + " (" + String.format("%.3f", epoch_counter) + " epochs).\n");
Log.info(msg);
}
}
}
代码示例来源:origin: h2oai/h2o-2
@Override protected Response serve() {
Job jjob = ( job_key != null )?Job.findJob(job_key):null;
if( jjob != null && jjob.exception != null )
return Response.error(jjob.exception == null ? "cancelled" : jjob.exception);
Value v = DKV.get(_modelKey);
if(v != null){
glm_model = v.get();
if(Double.isNaN(lambda) && glm_model.submodels.length != 0)
lambda = glm_model.submodels[glm_model.best_lambda_idx].lambda_value;
}
if( jjob == null || jjob.end_time > 0 || jjob.isCancelledOrCrashed() )
return Response.done(this);
return Response.poll(this,(int)(100*jjob.progress()),100,"_modelKey",_modelKey.toString());
}
代码示例来源:origin: h2oai/h2o-2
@Override protected Response serve() {
grid = DKV.get(grid_key).get();
Job j = null;
if((j = UKV.get(grid._jobKey)) != null){
switch(j.state){
case DONE: return Response.done(this);
case FAILED: return Response.error(j.exception);
case CANCELLED:return Response.error("Job was cancelled by user!");
case RUNNING: return Response.poll(this, (int) (100 * j.progress()), 100, "grid_key", grid_key.toString());
default: break;
}
}
return Response.poll(this, 0, 100, "grid_key", grid_key.toString());
}
}
代码示例来源:origin: h2oai/h2o-2
jobResult.addProperty("val", "OK");
json.addProperty(END_TIME, end == 0 ? "" : RequestBuilders.ISO8601.get().format(new Date(end)));
json.addProperty(PROGRESS, job.state==JobState.RUNNING || job.state==JobState.DONE ? jobs[i].progress() : -1);
json.addProperty(PROGRESS, end == 0 ? (cancelled ? -2 : jobs[i].progress()) : (cancelled ? -2 : -1));
json.addProperty(CANCELLED, cancelled);
json.add("result",jobResult);
代码示例来源:origin: h2oai/h2o-3
long workedSoFar = Math.round(subJob.progress() * work.share);
代码示例来源:origin: h2oai/h2o-3
Assert.assertTrue("Progress not 100%, but " + job._job.progress() *100, job._job.progress() == 1.0);
代码示例来源:origin: ai.h2o/h2o-algos
private void progressUpdate(Key<Job> job_key, boolean keep_running) {
updateTiming(job_key);
Job job = job_key.get();
double progress = job.progress();
// Log.info("2nd speed: (samples: " + model_info().get_processed_total() + ", total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")");
float speed = (float)(model_info().get_processed_total() * 1000. / (total_training_time_ms -total_scoring_time_ms-total_setup_time_ms));
assert(speed >= 0) : "negative speed computed! (total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")";
String msg =
"Iterations: " + String.format("%,d", iterations)
+ ". Epochs: " + String.format("%g", epoch_counter)
+ ". Speed: " + (speed>10 ? String.format("%d", (int)speed) : String.format("%g", speed)) + " samples/sec."
+ (progress == 0 ? "" : " Estimated time left: " + PrettyPrint.msecs((long) (total_training_time_ms * (1. - progress) / progress), true));
job.update(actual_train_samples_per_iteration,msg); //mark the amount of work done for the progress bar
long now = System.currentTimeMillis();
long sinceLastPrint = now -_timeLastPrintStart;
if (!keep_running || sinceLastPrint > get_params()._score_interval * 1000) { //print this after every score_interval, not considering duty cycle
_timeLastPrintStart = now;
if (!get_params()._quiet_mode) {
Log.info(
"Training time: " + PrettyPrint.msecs(total_training_time_ms, true) + " (scoring: " + PrettyPrint.msecs(total_scoring_time_ms, true) + "). "
+ "Processed " + String.format("%,d", model_info().get_processed_total()) + " samples" + " (" + String.format("%.3f", epoch_counter) + " epochs).\n");
Log.info(msg);
}
}
}
代码示例来源:origin: ai.h2o/h2o-algos
private void progressUpdate(Key<Job> job_key, boolean keep_running) {
updateTiming(job_key);
Job job = job_key.get();
double progress = job.progress();
// Log.info("2nd speed: (samples: " + model_info().get_processed_total() + ", total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")");
int speed = (int)(model_info().get_processed_total() * 1000. / (total_training_time_ms -total_scoring_time_ms-total_setup_time_ms));
assert(speed >= 0) : "negative speed computed! (total_run_time: " + total_training_time_ms + ", total_scoring_time: " + total_scoring_time_ms + ", total_setup_time: " + total_setup_time_ms + ")";
String msg =
"Iterations: " + String.format("%,d", iterations)
+ ". Epochs: " + String.format("%g", epoch_counter)
+ ". Speed: " + String.format("%,d", speed) + " samples/sec."
+ (progress == 0 ? "" : " Estimated time left: " + PrettyPrint.msecs((long) (total_training_time_ms * (1. - progress) / progress), true));
job.update(actual_train_samples_per_iteration,msg); //mark the amount of work done for the progress bar
long now = System.currentTimeMillis();
long sinceLastPrint = now -_timeLastPrintStart;
if (!keep_running || sinceLastPrint > get_params()._score_interval * 1000) { //print this after every score_interval, not considering duty cycle
_timeLastPrintStart = now;
if (!get_params()._quiet_mode) {
Log.info(
"Training time: " + PrettyPrint.msecs(total_training_time_ms, true) + " (scoring: " + PrettyPrint.msecs(total_scoring_time_ms, true) + "). "
+ "Processed " + String.format("%,d", model_info().get_processed_total()) + " samples" + " (" + String.format("%.3f", epoch_counter) + " epochs).\n");
Log.info(msg);
}
}
}
代码示例来源:origin: ai.h2o/h2o-automl
long workedSoFar = Math.round(subJob.progress() * work.share);
内容来源于网络,如有侵权,请联系作者删除!