Commit 8fbb3a43 authored by Jia's avatar Jia Committed by Commit Bot

[On-device adaptive brightness] More logging for sys report

This cl adds more logging into sys report so that we can help users
better when they file a bug report.

Bug: 881215
Change-Id: Iea0f1ef052d68ee608f64fed25e1a727b1c50c70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871719
Commit-Queue: Jia Meng <jiameng@chromium.org>
Reviewed-by: default avatarCharles . <charleszhao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708804}
parent fa9d2dee
...@@ -697,8 +697,13 @@ double Adapter::GetBrightnessBasedOnAmbientLogLux( ...@@ -697,8 +697,13 @@ double Adapter::GetBrightnessBasedOnAmbientLogLux(
double ambient_log_lux) const { double ambient_log_lux) const {
DCHECK_EQ(adapter_status_, Status::kSuccess); DCHECK_EQ(adapter_status_, Status::kSuccess);
// We use the latest curve available. // We use the latest curve available.
if (model_.personal_curve) if (model_.personal_curve) {
VLOG(1) << "ABAdapter using personal curve for brightness change: \n"
<< model_.personal_curve->ToString();
return model_.personal_curve->Interpolate(ambient_log_lux); return model_.personal_curve->Interpolate(ambient_log_lux);
}
VLOG(1) << "ABAdapter using global curve for brightness change: \n"
<< model_.global_curve->ToString();
return model_.global_curve->Interpolate(ambient_log_lux); return model_.global_curve->Interpolate(ambient_log_lux);
} }
......
...@@ -420,12 +420,16 @@ TrainingResult GaussianTrainer::Train( ...@@ -420,12 +420,16 @@ TrainingResult GaussianTrainer::Train(
if (!need_to_update_curve_) { if (!need_to_update_curve_) {
const double error = CalculateCurveError(data); const double error = CalculateCurveError(data);
LogModelCurveError(error, false /* model_updated */); LogModelCurveError(error, false /* model_updated */);
VLOG(1) << "ABTrainer training finished without new curve: \n"
<< current_curve_->ToString();
return TrainingResult(base::nullopt, error); return TrainingResult(base::nullopt, error);
} }
current_curve_ = MonotoneCubicSpline::CreateMonotoneCubicSpline( current_curve_ = MonotoneCubicSpline::CreateMonotoneCubicSpline(
ambient_log_lux_, brightness_); ambient_log_lux_, brightness_);
DCHECK(current_curve_); DCHECK(current_curve_);
VLOG(1) << "ABTrainer training finished with new curve: \n"
<< current_curve_->ToString();
need_to_update_curve_ = false; need_to_update_curve_ = false;
const double error = CalculateCurveError(data); const double error = CalculateCurveError(data);
...@@ -452,6 +456,11 @@ void GaussianTrainer::AdjustCurveWithSingleDataPoint( ...@@ -452,6 +456,11 @@ void GaussianTrainer::AdjustCurveWithSingleDataPoint(
const double brightness_global = const double brightness_global =
global_curve_->Interpolate(data.ambient_log_lux); global_curve_->Interpolate(data.ambient_log_lux);
VLOG(1) << "ABTrainer training data point (global,old,new,log_lux): "
<< FormatToPrint(brightness_global) << ", "
<< FormatToPrint(data.brightness_old) << ", "
<< FormatToPrint(data.brightness_new) << ", " << data.ambient_log_lux;
// Check if this |data| is an outlier and should be ignored. It's an outlier // Check if this |data| is an outlier and should be ignored. It's an outlier
// if its original/old brightness is too far off from the brightness as // if its original/old brightness is too far off from the brightness as
// predicted by the global curve. This assumes the global curve is reasonably // predicted by the global curve. This assumes the global curve is reasonably
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment