基于 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)
])

最低0.47元/天 解锁文章
638

被折叠的 条评论
为什么被折叠?



