This method will by called the Controller to perform an evaluation. The
num_steps parameter specifies the number of steps of evaluation to run,
which is specified by the user when calling one of the Controller's
evaluation methods. A special sentinel value of -1 is reserved to indicate
evaluation should run until the underlying data source is exhausted.
Args
num_steps
The number of evaluation steps to run. Note that it is up to
the model what constitutes a "step". Evaluations may also want to
support "complete" evaluations when num_steps == -1, running until a
given data source is exhausted.
Returns
Either None, or a dictionary mapping names to Tensors or NumPy values.
If a dictionary is returned, it will be written to logs and as TensorBoard
summaries. The dictionary may also be nested, which will generate a
hierarchy of summary directories.
with_name_scope
@classmethodwith_name_scope(method)
Decorator to automatically enter the module name scope.
[null,null,["Last updated 2025-04-18 UTC."],[],[],null,["# orbit.AbstractEvaluator\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/models/blob/v2.19.1/orbit/runner.py#L58-L83) |\n\nAn abstract class defining the API required for evaluation. \n\n orbit.AbstractEvaluator(\n name=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | Returns the name of this module as passed or determined in the ctor. \u003cbr /\u003e | **Note:** This is not the same as the `self.name_scope.name` which includes parent module names. |\n| `name_scope` | Returns a [`tf.name_scope`](https://www.tensorflow.org/api_docs/python/tf/name_scope) instance for this class. |\n| `non_trainable_variables` | Sequence of non-trainable variables owned by this module and its submodules.**Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n| `submodules` | Sequence of all sub-modules. Submodules are modules which are properties of this module, or found as properties of modules which are properties of this module (and so on). a = tf.Module() b = tf.Module() c = tf.Module() a.b = b b.c = c list(a.submodules) == [b, c] True list(b.submodules) == [c] True list(c.submodules) == [] True \u003cbr /\u003e |\n| `trainable_variables` | Sequence of trainable variables owned by this module and its submodules. \u003cbr /\u003e | **Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n| `variables` | Sequence of variables owned by this module and its submodules.**Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n\nMethods\n-------\n\n### `evaluate`\n\n[View source](https://github.com/tensorflow/models/blob/v2.19.1/orbit/runner.py#L61-L83) \n\n @abc.abstractmethod\n evaluate(\n num_steps: tf.Tensor\n ) -\u003e Optional[Output]\n\nImplements `num_steps` steps of evaluation.\n\nThis method will by called the `Controller` to perform an evaluation. The\n`num_steps` parameter specifies the number of steps of evaluation to run,\nwhich is specified by the user when calling one of the `Controller`'s\nevaluation methods. A special sentinel value of `-1` is reserved to indicate\nevaluation should run until the underlying data source is exhausted.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `num_steps` | The number of evaluation steps to run. Note that it is up to the model what constitutes a \"step\". Evaluations may also want to support \"complete\" evaluations when `num_steps == -1`, running until a given data source is exhausted. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Either `None`, or a dictionary mapping names to `Tensor`s or NumPy values. If a dictionary is returned, it will be written to logs and as TensorBoard summaries. The dictionary may also be nested, which will generate a hierarchy of summary directories. ||\n\n\u003cbr /\u003e\n\n### `with_name_scope`\n\n @classmethod\n with_name_scope(\n method\n )\n\nDecorator to automatically enter the module name scope. \n\n class MyModule(tf.Module):\n @tf.Module.with_name_scope\n def __call__(self, x):\n if not hasattr(self, 'w'):\n self.w = tf.Variable(tf.random.normal([x.shape[1], 3]))\n return tf.matmul(x, self.w)\n\nUsing the above module would produce [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable)s and [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor)s whose\nnames included the module name: \n\n mod = MyModule()\n mod(tf.ones([1, 2]))\n \u003ctf.Tensor: shape=(1, 3), dtype=float32, numpy=..., dtype=float32)\u003e\n mod.w\n \u003ctf.Variable 'my_module/Variable:0' shape=(2, 3) dtype=float32,\n numpy=..., dtype=float32)\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|---------------------|\n| `method` | The method to wrap. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The original method wrapped such that it enters the module's name scope. ||\n\n\u003cbr /\u003e"]]