This is targeting CTL users running an evaluator job, as opposed to alternating train/evaluate: 1) reading checkpoints as one becomes available, 2) evaluating the model with the dataset set aside for evaluation, 3) logging the evaluated metric, optionally generating summary file for TensorBoard, and optionally exporting the model considered the best so far for serving (TODO). It is possible for users to create such custom loop for evaluation, but this utility may be useful for standard, continuous evaluation that takes care of some details. This is also for feature parity with estimator. PiperOrigin-RevId: 339623940 Change-Id: I057fd255d46543003217ebbdc339155717c06044
23 lines
941 B
Python
23 lines
941 B
Python
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
# ==============================================================================
|
|
"""Keras' Distribution Strategy library."""
|
|
|
|
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
# pylint: disable=unused-import
|
|
from tensorflow.python.keras.distribute import sidecar_evaluator
|