国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

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

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

一、說明

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

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

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

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

2.1 概述

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

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

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

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

2.2 代碼實(shí)現(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í)驗(yàn)的部分結(jié)果示例?

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

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

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

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

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

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

引用:

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

    ·
http://m.aloenet.com.cn/news/34526.html

相關(guān)文章:

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