| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module media.learning.mojom; |
| |
| // learning::FeatureValue (common/value.h) |
| struct FeatureValue { |
| double value; |
| }; |
| |
| // learning::TargetValue (common/value.h) |
| struct TargetValue { |
| double value; |
| }; |
| |
| // learning::LabelledExample (common/training_example.h) |
| struct LabelledExample { |
| array<FeatureValue> features; |
| TargetValue target_value; |
| }; |
| |
| // learning::ObservationCompletion (common/learning_task_controller.h) |
| struct ObservationCompletion { |
| TargetValue target_value; |
| uint64 weight = 1; |
| }; |
| |
| // Hack for TargetHistogram. Would ideally be a map<TargetValue, double>, but |
| // this causes pain in the translation to WTF::HashMap. HashMap requires |
| // reservations for "deleted" and "empty" sentinel values. This is especially |
| // undesirable in our case because TargetValue (the map key) is designed to be |
| // completely generic, supporting any possible value for double. We instead |
| // use a list of pairs (key, value) to avoid having to reserve any values as |
| // "empty" or "deleted". |
| struct TargetHistogramPair { |
| TargetValue target_value; |
| double count; |
| }; |
| |
| // learning::TargetHistogram (common/target_histogram.h) |
| struct TargetHistogram { |
| array<TargetHistogramPair> pairs; |
| }; |