摘要: 1 import tensorflow as tf 2 import os 3 4 5 mnist = tf.keras.datasets.mnist 6 (x_train, y_train), (x_test, y_test) = mnist.load_data() 7 x_train, x_te 阅读全文
posted @ 2020-05-06 22:23 WWBlog 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #注意训练时间较长,建议在google colab上计算。 1 import tensorflow as tf 2 from tensorflow.keras.preprocessing.image import ImageDataGenerator 3 4 mnist = tf.keras.dat 阅读全文
posted @ 2020-05-06 21:19 WWBlog 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding: utf-8 -*- 2 3 import tensorflow as tf 4 from PIL import Image 5 import numpy as np 6 import os 7 8 rt_path = '/home/ubuntu/Documents/中 阅读全文
posted @ 2020-05-05 22:30 WWBlog 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1 # 显示原始图像和增强后的图像 2 import tensorflow as tf 3 from matplotlib import pyplot as plt 4 from tensorflow.keras.preprocessing.image import ImageDataGenerat 阅读全文
posted @ 2020-05-05 20:39 WWBlog 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 import matplotlib.pyplot as plt 3 4 x = np.linspace(0, 2 * np.pi, 50) 5 y = np.sin(x) 6 7 plt.figure(figsize=(6, 6)) 8 plt.plot 阅读全文
posted @ 2020-05-05 15:40 WWBlog 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1 import tensorflow as tf 2 3 fashion = tf.keras.datasets.fashion_mnist 4 (x_train, y_train), (x_test, y_test) = fashion.load_data() 5 6 print(x_train 阅读全文
posted @ 2020-05-04 23:05 WWBlog 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 1 import tensorflow as tf 2 from matplotlib import pyplot as plt 3 4 5 mnist = tf.keras.datasets.mnist 6 (x_train, y_train), (x_test, y_test) = mnist. 阅读全文
posted @ 2020-05-04 22:40 WWBlog 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1 import tensorflow as tf 2 from tensorflow.keras.layers import Dense 3 from tensorflow.keras import Model 4 from sklearn import datasets 5 import num 阅读全文
posted @ 2020-05-04 21:38 WWBlog 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 1 import tensorflow as tf 2 from sklearn import datasets 3 import numpy as np 4 5 6 x_train = datasets.load_iris().data 7 y_train = datasets.load_iris 阅读全文
posted @ 2020-05-04 19:46 WWBlog 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 1 # 利用鸢尾花数据集,实现前向传播、反向传播,可视化loss曲线 2 3 # 导入所需模块 4 import numpy as np 5 import tensorflow as tf 6 from sklearn import datasets 7 from matplotlib import 阅读全文
posted @ 2020-05-04 17:33 WWBlog 阅读(524) 评论(0) 推荐(0) 编辑