吴恩达 tensorflow2.0 实践系列课程(1):基础

基于 tensorflow2.0 的人工智能、机器学习和深度学习简介和基础编程

因为已经比较熟悉了,所以记录得非常简单。

1.1 Introduction - A conversation with Andrew Ng

主讲:Laurence Moroney

Learn how to code in TensorFlow and the difference between traditional programming paradigms versus the machine learning and deep learning programming paradigms.

1.2 A primer in machine learning

Traditional Programming VS Machine Learning

在这里插入图片描述
给定一堆我们平时见到的样例(answes),让 machine 去寻找其中的 rules。
人为设定较为完善的规则很难,比如走路、跑步、骑车,甚至打高尔夫细节很多,各有差异。但是可以给 machine 很多例子,给定 answer,让 machine 寻找其中的 rules。

1.3 The ‘Hello World’ of neural networks

核心:machine 在模仿人,看到两个变量关系时,试图 guess,guess 答案之后,再看看 guess 得怎么样,逐步迭代。

model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])])
model.compile(optimizer='sgd', loss='mean_squared_error')

xs = np.array([], dtype=float])
ys = np.array([], dtype=float)

model.fit(xs, ys, epoch=500)

print(model.predict([10.0]))

这里,结果接近标准答案,但并不一定会是标准答案:

  • 训练数据很少;
  • 神经网络按照概率来输出预测。

1.4 Working through ‘Hello World’ in Tensorflow and Python

使用的 Googlo Colab,需要科学上网。

loss 会越来越小。

2.1 Conversation with Andrew Ng

神经网络处理直线是 ‘Hello World,下面仍然沿用上面整体的流程模板,使用图像数据集,来完成 computer vision 的任务。

2.2 An introduction to computer vision

数据集:

  • Fashion MNIST
  • 70k Images
  • 10 Categories
  • Images are 28 × 28
  • Can train a neural net!
  • binary 0 or 255
  • single image’size is 28 × 28 bytes
  • 在 tensorflow 中有 dataset api

2.3 Writing code to load training data

fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()

2.4 Coding a Computer Vision Neural Network

定义模型结构

model = keras.Sequential([
	keras.layers.Flatten(input_shape=(28, 28)),
	keras.layers.Dense(128, activation=tf.nn.relu),
	keras.layers.Dense(10, activation=tf.nn.softmax)
])

2.5 Working through a

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值