Support weights in TrainingDataStorage.

Since we'll end up pushing many copies of the same (possibly
weighted) examples into TrainingDataStorage, support weights there
directly.  This lets us de-duplicate them in the future, to save
both space and training time.

Note that TrainingData snapshots these weights, so that one may
continue to update the weights in TrainingDataStorage, without
affecting any outstanding references to them.  This will allow us
to collect training data while training is in progress, without
requiring a copy of the storage.

This CL does not add the ability to de-duplicate identical
examples to TrainingDataStorage.

Change-Id: I207cb6d5c85ce83ba803f935adc300cfa284dd75
Reviewed-on: https://chromium-review.googlesource.com/c/1372272
Commit-Queue: Frank Liberato <liberato@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616433}
8 files changed