tensosflow.keras.Sequential 的 evaluate() 函数总结
def evaluate(self,
x=None,
y=None,
batch_size=None,
verbose=1,
sample_weight=None,
steps=None,
callbacks=None,
max_queue_size=10,
workers=1,
use_multiprocessing=False):
“”"
返回损失值和度量值(metrics)
参数说明:
x: Input data. It could be:
- A Numpy array (or array-like), or a list of arrays
(in case the model has multiple inputs).
- A dict mapping input names to the corresponding
array/tensors, if the model has named inputs.
- A generator or keras.utils.Sequence
returning
(inputs, targets)
or (inputs, targets, sample weights)
.
- None (default) if feeding from framework-native
tensors (e.g. TensorFlow data tensors).
y: Target data. Like the input data x
,
it could be either Numpy array(s), framework-native tensor(s),
list of Numpy arrays (if the model has multiple outputs) or
None (default) if feeding from framework-native tensors
(e.g. TensorFlow data tensors).
If output layers in the model are named, you can also pass a
dictionary mapping output names to Numpy arrays.
If x
is a generator, or keras.utils.Sequence
instance,
y
should not be specified (since targets will be obtained
from x
).
batch_size: Integer or None
.
Number of samples per gradient update.
If unspecified, batch_size
will default to 32.
Do not specify the batch_size
if your data is in the
form of symbolic tensors, generators, or
keras.utils.Sequence
instances (since they generate batches).
verbose: 0 or 1. Verbosity mode.
0 = silent, 1 = progress bar.
sample_weight: Optional Numpy array of weights for
the test samples, used for weighting the loss function.
You can either pass a flat (1D)
Numpy array with the same length as the input samples
(1:1 mapping between weights and samples),
or in the case of temporal data,
you can pass a 2D array with shape
(samples, sequence_length)
,
to apply a different weight to every timestep of every sample.
In this case you should make sure to specify
sample_weight_mode="temporal"
in compile()
.
steps: Integer or None
.
Total number of steps (batches of samples)
before declaring the evaluation round finished.
Ignored with the default value of None
.
callbacks: List of keras.callbacks.Callback
instances.
List of callbacks to apply during evaluation.
See callbacks.
max_queue_size: Integer. Used for generator or keras.utils.Sequence
input only. Maximum size for the generator queue.
If unspecified, max_queue_size
will default to 10.
workers: Integer. Used for generator or keras.utils.Sequence
input
only. Maximum number of processes to spin up when using
process-based threading. If unspecified, workers
will default
to 1. If 0, will execute the generator on the main thread.
use_multiprocessing: Boolean. Used for generator or
keras.utils.Sequence
input only. If True
, use process-based
threading. If unspecified, use_multiprocessing
will default to
False
. 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.
#Raises
ValueError: in case of invalid arguments.
#Returns
Scalar test loss (if the model has a single output and no metrics)
or list of scalars (if the model has multiple outputs
and/or metrics). The attribute model.metrics_names
will give you
the display labels for the scalar outputs.
稍后给出翻译
tensosflow.keras.Sequential 的 evaluate() 函数总结相关推荐
- keras中model.evaluate()函数使用从flow_from_directory中生成的测试集一直循环问题
目录 一.从test_generator中提取(x_test,y_test) 二.升级TensorFlow或者TensorFlow-gpu后 ,问题得到解决 三.与predict()函数的区别 四.顺 ...
- keras中model的evaluate函数的返回值究竟是什么?
不少帖子都解释evaluate()函数的返回值是什么,但是通常都让人看得云里雾里,其实该函数第一个返回值是损失(loss),第二个返回值是准确率(acc).可以通过打印model.metrics_na ...
- evaluate函数使用无效_在Matlab中使用tensorflow (2)
本篇介绍如何在matlab中调用python训练好的网络模型和权重. 系统环境:win10,matlab2018b,python3.6,tensorflow1.1 代码如下: tf = py.impo ...
- Keras Sequential顺序模型
Keras Sequential顺序模型 keras是基于tensorflow封装的的高级API,Keras的优点是可以快速的开发实验,它能够以TensorFlow, CNTK, 或者 Theano ...
- format函数_畅游人工智能之海 | Keras教程之后端函数(一)
BBIT 畅游人工智能之海 --Keras教程之 后端函数(一) Artificial Intelligence 今天我们要开始学习Keras的后端函数. 首先我们要了解什么是后端.Keras依赖于一 ...
- Keras Sequential 模型
Last updated: 2022-06-27, 11:26 1. 配置 import tensorflow as tf from tensorflow import keras from tens ...
- 怎么计算另一个表格内某几列的和_Excel 函数(一) – 用 evaluate 函数自动计算
以前写过不少函数,但都是以实际案例操作的形式写,标题上没有专门开个组别.随着问的人增多,发现有必要给函数的使用开个新的组别,便于网友查找. 在某几列中输入数值后,要在指定列中自动显示所需的计算结果(假 ...
- evaluate函数使用无效_我用这个Excel函数,秀了同事一脸!很多人却连它名字都没听过...
最近收到在某快递上班的周同学问题求助,主要是在计算包裹的体积时遇到了些麻烦事. 下表是周同学近期整理的快递包裹尺寸数据,其中重要一项工作就是通过长*宽*高来计算出包裹的体积. 周同学表示其实自己也能做 ...
- keras中的回调函数
keras训练 fit(self, x, y, batch_size=32, nb_epoch=10, verbose=1, callbacks=[], validation_split=0.0, v ...
最新文章
- C#中实现文件重命名的方式
- Java 中array.size()_Java ArrayDeque size()方法与示例
- Python爬虫番外篇之Cookie和Session
- ie系列浏览器_2020下半年河北教师资格准考证打印只能用ie浏览器吗
- PHP验证码识别实例
- Python序列循环移位的3种方法
- python编程英语单词下载2019_图形化编程软件-mPython下载2019正式版 下载_久友软件下载...
- javascript php 界面,js实现卡片式项目管理界面UI设计效果_javascript技巧
- Java学习笔记——final
- 3.SRE:Google运维解密 --- 拥抱风险
- Android应用安全
- 性能评测方法、各评测项标准总结
- TP-LINK无线路由器WR340G+ 54M支持WDS - 东莞市泰讯电子科技有限公司
- nmap——端口扫描_基础命令
- java.sql.SQLException: ORA-00911: 无效字符(编译器大坑)
- 激光物理学取得突破,三大物理学家共获诺贝尔奖
- 【联邦学习】联邦学习量化——non-iid数据集下的仿真
- Python快速上手系列--类--详解篇
- 泸州市的电子计算机学校名称,泸州市电子机械学校 学校图片简介
- MySQL创建索引-阿里云开发者社区
热门文章
- 产品的不可或缺性调查
- 特征提取算法——BRISK(Binary Robust Invariant Scalable Kepoints)学习笔记
- 如何在微信服务号每天推送消息?
- Random walk(期望值和方差)
- Docker 中部署 Greenplum
- ubuntu 16.04 安装微信 (亲测有效)
- django配置文件中的allow_hosts有什么用?
- 【Redis】Redis最大连接数maxTotal设置过小的问题
- Python——成员变量和类变量
- Python文本挖掘练习(五)// 电商产品评论数据情感分析