tf-keras-skeleton.py 文件源码

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

项目:LIE 作者: EmbraceLife 项目源码 文件源码
def predict_classes(self, x, batch_size=32, verbose=1):
        """Generate class predictions for the input samples.

        The input samples are processed batch by batch.

        Arguments:
            x: input data, as a Numpy array or list of Numpy arrays
                (if the model has multiple inputs).
            batch_size: integer.
            verbose: verbosity mode, 0 or 1.

        Returns:
            A numpy array of class predictions.
        """
        proba = self.predict(x, batch_size=batch_size, verbose=verbose)
        if proba.shape[-1] > 1:
          return proba.argmax(axis=-1)
        else:
          return (proba > 0.5).astype('int32')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号