Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
使用
TensorFlow
自定义模型和训练
333
到数百个 TensorFlow 项目,通常很容易找到你想要的代码。
越来越多的 ML 论文连同实现一起发布,有时甚至带有预训练的模型。查看
https://paperswithcode.com/
,可以轻松找到它们。
最后但并非不重要的一点是,TensorFlow 拥有一支热情而乐于助人的开发人员组成
的团队以及一个大型社区,致力于对其进行改进。要问技术问题,你应该使用
http://
stackoverflow.com/
并用
tensorflow
python
标记你的问题。你可以通过 GitHub 提交错
误和功能请求。有关一般讨论,请加入 Google 讨论组。
好的,该开始编码了!
12.2 NumPy 一样使用 TensorFlow
TensorFlow API 一切都围绕张量,张量从一个操作流向另一个操作,因此命名为
Tensor
Flow
。张量非常类似 NumPy ndarray,它通常是一个多维度组,但它也可以
保存标量(简单值,例如 42)。当我们创建自定义成本函数、自定义指标、自定义层等
时,这些张量将非常重要,因此让我们来看看如何创建和操作它们。
12.2.1 张量和操作
你可以使用 tf.constant() 创建张量。例如,这是一个张量,表示具有两行三列浮点
数的矩阵:
>>>
tf.constant([[1., 2., 3.], [4., 5., 6.]]) #
matrix
<tf.Tensor: id=0, shape=(2, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
Go语言编程

Go语言编程

威廉·肯尼迪
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977