Commit 250879a4 authored by Andrew Moylan's avatar Andrew Moylan Committed by Commit Bot

Use 20190521 model for SmartDimModelV3

Change the model that SmartDimModelV3 flag uses.
This flag is not enabled via Finch for any users yet.

* Add 20190521 preprocessor .pb file
* Remove 20190221 preprocessor .pb file

	flag through chrome://flags, and manually invoked Smart Dim via
	its D-Bus interface.

Bug: chromium:937063
Change-Id: Iac3a1613c0d3ce2af830e6eedda1cfa13eec9d31
Tested: Pushed updated Chrome to DUT, enabled the SmartDimV3 feature
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813538
Auto-Submit: Andrew Moylan <amoylan@chromium.org>
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: default avatarJia Meng <jiameng@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698378}
parent 27c9afdd
......@@ -615,7 +615,7 @@
</if>
<if expr="chromeos">
<include name="IDR_SMART_DIM_20181115_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="chromeos\power\ml\smart_dim\20181115_example_preprocessor_config.pb" type="BINDATA" />
<include name="IDR_SMART_DIM_20190221_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="chromeos\power\ml\smart_dim\20190221_example_preprocessor_config.pb" type="BINDATA" />
<include name="IDR_SMART_DIM_20190521_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="chromeos\power\ml\smart_dim\20190521_example_preprocessor_config.pb" type="BINDATA" />
<include name="IDR_TOP_CAT_20190722_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="ui\app_list\search\search_result_ranker\20190722_example_preprocessor_config.pb" type="BINDATA" />
</if>
<if expr="chromeos">
......
......@@ -133,7 +133,7 @@ void MlServiceClientImpl::InitMlServiceHandlesIfNeeded() {
// Load the model.
ModelSpecPtr spec =
ModelSpec::New(base::FeatureList::IsEnabled(features::kSmartDimModelV3)
? ModelId::SMART_DIM_20190221
? ModelId::SMART_DIM_20190521
: ModelId::SMART_DIM_20181115);
chromeos::machine_learning::ServiceConnection::GetInstance()->LoadModel(
std::move(spec), mojo::MakeRequest(&model_),
......
......@@ -33,10 +33,10 @@ namespace ml {
namespace {
constexpr size_t k20181115ModelInputVectorSize = 343;
constexpr size_t k20190221ModelInputVectorSize = 612;
constexpr size_t k20190521ModelInputVectorSize = 592;
constexpr double k20181115ModelDefaultDimThreshold = -1.0;
constexpr double k20190221ModelDefaultDimThreshold = -0.55;
constexpr double k20190521ModelDefaultDimThreshold = -0.6;
// Loads the preprocessor config protobuf, which will be used later to convert a
// RankerExample to a vectorized float for inactivity score calculation. Returns
......@@ -47,7 +47,7 @@ LoadExamplePreprocessorConfig() {
const int res_id =
base::FeatureList::IsEnabled(features::kSmartDimModelV3)
? IDR_SMART_DIM_20190221_EXAMPLE_PREPROCESSOR_CONFIG_PB
? IDR_SMART_DIM_20190521_EXAMPLE_PREPROCESSOR_CONFIG_PB
: IDR_SMART_DIM_20181115_EXAMPLE_PREPROCESSOR_CONFIG_PB;
scoped_refptr<base::RefCountedMemory> raw_config =
......@@ -228,7 +228,7 @@ void LogPowerMLSmartDimParameterResult(SmartDimParameterResult result) {
float GetDimThreshold() {
const double default_threshold =
base::FeatureList::IsEnabled(features::kSmartDimModelV3)
? k20190221ModelDefaultDimThreshold
? k20190521ModelDefaultDimThreshold
: k20181115ModelDefaultDimThreshold;
const double dim_threshold = base::GetFieldTrialParamByFeatureAsDouble(
features::kUserActivityPrediction, "dim_threshold", default_threshold);
......@@ -317,7 +317,7 @@ void SmartDimModelImpl::ShouldDim(
const size_t expected_size =
base::FeatureList::IsEnabled(features::kSmartDimModelV3)
? k20190221ModelInputVectorSize
? k20190521ModelInputVectorSize
: k20181115ModelInputVectorSize;
if (vectorized_features.size() != expected_size) {
......
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