中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

百度付費推廣圖片seo優(yōu)化是什么意思

百度付費推廣,圖片seo優(yōu)化是什么意思,可以做動態(tài)影集的網(wǎng)站,做一個軟件需要哪些技術一、說明 自動編碼器是一種無監(jiān)督學習的神經網(wǎng)絡模型,主要用于降維或特征提取。常見的自動編碼器包括基本的單層自動編碼器、深度自動編碼器、卷積自動編碼器和變分自動編碼器等。 其中,基本的單層自動編碼器由一個編碼器和一個解碼器組成,編…

一、說明

????????自動編碼器是一種無監(jiān)督學習的神經網(wǎng)絡模型,主要用于降維或特征提取。常見的自動編碼器包括基本的單層自動編碼器、深度自動編碼器、卷積自動編碼器和變分自動編碼器等。

????????其中,基本的單層自動編碼器由一個編碼器和一個解碼器組成,編碼器將輸入數(shù)據(jù)壓縮成低維數(shù)據(jù),解碼器將低維數(shù)據(jù)還原成原始數(shù)據(jù)。深度自動編碼器是在單層自動編碼器的基礎上增加了多個隱藏層,可以實現(xiàn)更復雜的特征提取。卷積自動編碼器則是針對圖像等數(shù)據(jù)特征提取的一種自動編碼器,它使用卷積神經網(wǎng)絡進行特征提取和重建。變分自動編碼器則是一種生成式模型,可以用于生成新的數(shù)據(jù)樣本。

????????總的來說,不同類型的自動編碼器適用于不同類型的數(shù)據(jù)和問題,選擇合適的自動編碼器可以提高模型的性能。

二、在Minist數(shù)據(jù)集實現(xiàn)自動編碼器

2.1 概述

????????本文中的代碼用于在 MNIST 數(shù)據(jù)集上訓練自動編碼器。自動編碼器是一種旨在重建其輸入的神經網(wǎng)絡。在此腳本中,自動編碼器由兩個較小的網(wǎng)絡組成:編碼器和解碼器。編碼器獲取輸入圖像,將其壓縮為 64 個特征,并將編碼表示傳遞給解碼器,然后解碼器重建輸入圖像。自動編碼器通過最小化重建圖像和原始圖像之間的均方誤差來訓練。該腳本首先加載 MNIST 數(shù)據(jù)集并規(guī)范化像素值。然后,它將圖像重塑為一維表示,以便可以將其輸入神經網(wǎng)絡。之后,使用tensorflow.keras庫中的輸入層和密集層創(chuàng)建編碼器和解碼器模型。自動編碼器模型是通過鏈接編碼器和解碼器模型創(chuàng)建的。然后使用亞當優(yōu)化器和均方誤差損失函數(shù)編譯自動編碼器。最后,自動編碼器在歸一化和重塑的MNIST圖像上訓練25個epoch。通過繪制訓練集和測試集在 epoch 上的損失來監(jiān)控訓練進度。訓練后,腳本繪制一些測試圖像及其相應的重建。此外,還計算了原始圖像和重建圖像之間的均方誤差和結構相似性指數(shù)(SSIM)。

????????下圖顯示了模型的良好擬合,可以看到模型的良好擬合。

訓練和測試數(shù)據(jù)的模型丟失

????????該代碼比較兩個圖像,一個來自測試集的原始圖像和一個由自動編碼器生成的預測圖像。它使用該函數(shù)計算兩個圖像之間的均方誤差 (MSE),并使用 scikit-image 庫中的函數(shù)計算兩個圖像之間的結構相似性指數(shù) (SSIM)。根據(jù) mse 和 ssim 代碼檢索test_labels以打印測試圖像的值。msessim

2.2 代碼實現(xiàn)

import numpy as np
import tensorflow
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.models import Model
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Input, Dense, Flatten
from tensorflow.keras.layers import Layer 
from skimage import metrics
## import os can be skipped if there is nocompatibility issue 
## with the OpenMP library and TensorFlow 
import os
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"# Load the MNIST dataset
(x_train, train_labels), (x_test, test_labels) = mnist.load_data()# Normalize the data
x_train = x_train.astype('float32') / 255.
x_test = x_test.astype('float32') / 255.# Flatten the images
x_train = x_train.reshape((len(x_train), np.prod(x_train.shape[1:])))
x_test = x_test.reshape((len(x_test), np.prod(x_test.shape[1:])))# Randomize both the training and test
permutation = np.random.permutation(len(x_train))
x_train, train_labels = x_train[permutation], train_labels[permutation]
permutation = np.random.permutation(len(x_test))
x_test, test_labels = x_test[permutation], test_labels[permutation]
# Create the encoderlist_xtest = [ [x_test[i], test_labels[i]] for i in test_labels] 
print(len(list_xtest)) encoder_input = Input(shape=(784,))
encoded = Dense(64, activation='relu')(encoder_input)
encoder = Model(encoder_input, encoded)# Create the decoder
decoder_input = Input(shape=(64,))
decoded = Dense(784, activation='sigmoid')(decoder_input)
decoder = Model(decoder_input, decoded)# Create the autoencoder
autoencoder = Model(encoder_input, decoder(encoder(encoder_input)))lr_schedule = tensorflow.keras.optimizers.schedules.ExponentialDecay(initial_learning_rate = 5e-01, decay_steps = 2500, decay_rate = 0.75,staircase=True) 
tensorflow.keras.optimizers.Adam(learning_rate = lr_schedule,beta_1=0.95,beta_2=0.99,epsilon=1e-01)
autoencoder.compile(optimizer='adam', loss='mean_squared_error')# Train the autoencoder
history = autoencoder.fit(x_train, x_train,epochs=25,batch_size=512,shuffle=True,validation_data=(x_test, x_test))# Plot the training history
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('Model loss')
plt.ylabel('Loss')
plt.xlabel('Epoch')
plt.legend(['Train', 'Test'], loc='upper right')
plt.show()# Plot the test figures vs. predicted figures
decoded_imgs = autoencoder.predict(x_test)def mse(imageA, imageB):err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)err /= float(imageA.shape[0])return errdef ssim(imageA, imageB):return metrics.structural_similarity(imageA, imageB,channel_axis=None)decomser = [] 
decossimr = [] 
n = 10
list_xtestn = [ [x_test[i], test_labels[i]] for i in range(10)] 
print([list_xtestn[i][1] for i in range(n)]) 
plt.figure(figsize=(20, 4))
for i in range(n):# Display originalax = plt.subplot(2, n, i + 1)plt.imshow(x_test[i].reshape(28, 28))plt.gray()ax.get_xaxis().set_visible(False)ax.get_yaxis().set_visible(False)# Display reconstructionax = plt.subplot(2, n, i + 1 + n)plt.imshow(decoded_imgs[i].reshape(28, 28))plt.gray()ax.get_xaxis().set_visible(False)ax.get_yaxis().set_visible(False)if mse(list_xtestn[i][0],decoded_imgs[i]) <= 0.01: msel = mse(list_xtestn[i][0],decoded_imgs[i])decomser.append(list_xtestn[i][1])  if ssim(list_xtestn[i][0],decoded_imgs[i]) > 0.85:ssiml = ssim(list_xtestn[i][0],decoded_imgs[i])decossimr.append(list_xtestn[i][1])   print("mse and ssim for image %s are %s and %s" %(i,msel,ssiml)) 
plt.show() print(decomser)
print(decossimr)

三、實驗的部分結果示例?

????????該模型可以預測手寫數(shù)據(jù),如下所示。

原始數(shù)據(jù)和預測數(shù)據(jù)

????????此外,使用MSE和ssim方法將預測圖像與測試圖像進行比較,可以訪問test_labels并打印預測數(shù)據(jù)。

預測和測試圖像的 MSE 和 SSM 值,以及 SSE 和 SSIM 方法test_labels返回的數(shù)字列表

????????此代碼演示如何使用自動編碼器通過圖像比較教程來訓練和建立手寫識別網(wǎng)絡。一開始,訓練和測試圖像是隨機的,因此每次運行的圖像集都不同。

????????在另一篇文章中,我們將展示如何使用 Padé 近似值作為自動編碼器 (link.medium.com/cqiP5bd9ixb)?的激活函數(shù)。

引用:

  1. 原始的MNIST數(shù)據(jù)集:LeCun,Y.,Cortes,C.和Burges,C.J.(2010)。MNIST手寫數(shù)字數(shù)據(jù)庫。AT&T 實驗室 [在線]。可用:?http://yann。萊昆。com/exdb/mnist/
  2. 自動編碼器概念和應用:Hinton,G.E.和Salakhutdinov,R.R.(2006)。使用神經網(wǎng)絡降低數(shù)據(jù)的維數(shù)??茖W, 313(5786), 504–507.
  3. 使用自動編碼器進行圖像重建:Masci,J.,Meier,U.,Cire?an,D.和Schmidhuber,J.(2011年52月)。用于分層特征提取的堆疊卷積自動編碼器。在人工神經網(wǎng)絡國際會議(第 59-<> 頁)中。施普林格,柏林,海德堡。
  4. The tensorflow.keras library: Chollet, F. (2018).使用 Python 進行深度學習。紐約州謝爾特島:曼寧出版公司
  5. 均方誤差損失函數(shù)和亞當優(yōu)化器:Kingma,D.P.和Ba,J.(2014)。Adam:一種隨機優(yōu)化的方法。arXiv預印本arXiv:1412.6980。
  6. 結構相似性指數(shù)(SSIM):Wang,Z.,Bovik,A.C.,Sheikh,H.R.和Simoncelli,E.P.(2004)。圖像質量評估:從錯誤可見性到結構相似性。IEEE圖像處理事務,13(4),600-612。
  7. 弗朗西斯·貝尼斯坦特

    ·
http://www.risenshineclean.com/news/34526.html

相關文章:

  • 上海最新發(fā)布最新發(fā)布煙臺seo網(wǎng)絡推廣
  • wordpress手機QQ登錄seo服務商排名
  • php mysql動態(tài)網(wǎng)站開發(fā)與全程實例網(wǎng)絡營銷工具的特點
  • 網(wǎng)站開發(fā)用哪種語言天津的網(wǎng)絡優(yōu)化公司排名
  • 網(wǎng)站開發(fā)模版百度官網(wǎng)認證價格
  • 網(wǎng)站除了做流量還需要什么培訓機構不退費最有效方式
  • 網(wǎng)站項目團隊介紹怎么寫阿里域名注冊網(wǎng)站
  • 北京華人博學營銷型網(wǎng)站建設公司杭州排名優(yōu)化公司電話
  • 做恒生指數(shù)看什么網(wǎng)站免費發(fā)廣告的軟件
  • 網(wǎng)站注冊費公眾號推廣方法
  • 上海浦東建設集團官方網(wǎng)站英文網(wǎng)站建設
  • wordpress網(wǎng)站的根目錄在哪關鍵詞搜索排行榜
  • 西昌城鄉(xiāng)建設網(wǎng)站曹操博客seo
  • 免費做網(wǎng)站的軟件seminar是什么意思
  • 廣州網(wǎng)站開發(fā)技術網(wǎng)推平臺有哪些比較好
  • 專業(yè)網(wǎng)站設計團隊日本櫻花免m38vcom費vps
  • 做的比較好的卡車網(wǎng)站網(wǎng)站策劃是什么
  • 做網(wǎng)站遇到競爭對手怎么辦秘密入口3秒自動進入
  • 棗莊做網(wǎng)站優(yōu)化網(wǎng)站客服系統(tǒng)
  • 萬網(wǎng)域名申請網(wǎng)站全自動推廣引流軟件
  • 網(wǎng)站上的logo怎么做今日國內新聞
  • 網(wǎng)站設計聯(lián)盟西安seo學院
  • 網(wǎng)站開發(fā)wbs工作分解結構北京互聯(lián)網(wǎng)公司有哪些
  • wordpress背景圖更改網(wǎng)站自然優(yōu)化
  • 北京網(wǎng)站如何制作seo網(wǎng)站關鍵詞優(yōu)化快速官網(wǎng)
  • wordpress 入侵視頻優(yōu)化營商環(huán)境條例全文
  • 怎么設計app太原seo排名外包
  • 做app好還是響應式網(wǎng)站深圳企業(yè)黃頁網(wǎng)
  • 萊蕪營銷型網(wǎng)站制作廣東省各城市疫情搜索高峰進度
  • 網(wǎng)絡營銷案例分析200字關鍵詞seo如何優(yōu)化