tf-keras-skeleton.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:LIE 作者: EmbraceLife 项目源码 文件源码
def evaluate_generator(self,
                             generator,
                             steps,
                             max_q_size=10,
                             workers=1,
                             pickle_safe=False):
        """Evaluates the model on a data generator.

        The generator should return the same kind of data
        as accepted by `test_on_batch`.

        Arguments:
            generator: Generator yielding tuples (inputs, targets)
                or (inputs, targets, sample_weights)
            steps: Total number of steps (batches of samples)
                to yield from `generator` before stopping.
            max_q_size: maximum size for the generator queue
            workers: maximum number of processes to spin up
            pickle_safe: if True, use process based threading.
                Note that because this implementation
                relies on multiprocessing, you should not pass
                non picklable arguments to the generator
                as they can't be passed easily to children processes.

        Returns:
            Scalar test loss (if the model has no metrics)
            or list of scalars (if the model computes other metrics).
            The attribute `model.metrics_names` will give you
            the display labels for the scalar outputs.

        Raises:
            RuntimeError: if the model was never compiled.
        """
        if self.model is None:
          raise RuntimeError('The model needs to be compiled ' 'before being used.')
        return self.model.evaluate_generator(
            generator,
            steps,
            max_q_size=max_q_size,
            workers=workers,
            pickle_safe=pickle_safe)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号