91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-16
  • 語言: Python
  • 標簽: tensor??

資源簡介

tensorflow實現服裝類別分類,包括模型訓練、驗證及保存,例子本身從tensorflow官網學習而來,親自進行了實現,代碼可用。環境搭建可參考個人博文。

資源截圖

代碼片段和文件信息

#!/usr/bin/env?python?
#?-*-?coding:utf-8?-*-

#?TensorFlow?and?tf.keras
import?tensorflow?as?tf
from?tensorflow?import?keras

#?Helper?libraries
import?numpy?as?np
import?matplotlib.pyplot?as?plt

fashion_mnist?=?keras.datasets.fashion_mnist

(train_images?train_labels)?(test_images?test_labels)?=?fashion_mnist.load_data()

class_names?=?[‘T-shirt/top‘?‘Trouser‘?‘Pullover‘?‘Dress‘?‘Coat‘
???????????????‘Sandal‘?‘Shirt‘?‘Sneaker‘?‘Bag‘?‘Ankle?boot‘]

train_images.shape;

train_labels_len?=?len(train_labels);
print(train_labels_len)
print(train_labels)

test_images.shape

test_labels_len?=?len(test_labels);
print(test_labels_len)
print(test_labels)

#?plt.figure()
#?plt.imshow(train_images[0])
#?plt.colorbar()
#?plt.grid(False)
#?plt.show()
train_images?=?train_images?/?255.0

test_images?=?test_images?/?255.0

#?plt.figure(figsize=(1010))
#?for?i?in?range(25):
#?????plt.subplot(55i+1)
#?????plt.xticks([])
#?????plt.yticks([])
#?????plt.grid(F

評論

共有 條評論