SciPy

SciPy是一款適用于PC平臺的應用軟件,軟件大小為7.4MB。

SciPy基本信息

軟件名稱 SciPy 軟件平臺 pc
軟件版本 0.10.1 軟件語言 英語
軟件大小 7.4MB 軟件授權 免費

SciPy造價信息

市場價 信息價 詢價
材料名稱 規(guī)格/型號 市場價
(除稅)
工程建議價
(除稅)
行情 品牌 單位 稅率 供應商 報價日期
暫無數(shù)據(jù)
材料名稱 規(guī)格/型號 除稅
信息價
含稅
信息價
行情 品牌 單位 稅率 地區(qū)/時間
暫無數(shù)據(jù)
材料名稱 規(guī)格/需求量 報價數(shù) 最新報價
(元)
供應商 報價地區(qū) 最新報價時間
暫無數(shù)據(jù)

SciPy常見問題

SciPy文獻

AvayaVSCiscoUC產品技術比較 AvayaVSCiscoUC產品技術比較

格式:pdf

大?。?span id="cmgseay" class="single-tag-height">560KB

頁數(shù): 3頁

評分: 4.4

AvayaVSCiscoUC產品技術比較

立即下載
sc冷壓端子 sc冷壓端子

格式:pdf

大小:560KB

頁數(shù): 26頁

評分: 4.4

日成接線端子系列 Wire Terminals 日成接線端子系列 Wire Terminals RCCN C79 日 成 端 子 產 品 介 紹 RCCN 日成端子產品介紹 WWW.RCCN.COM.CN Disconnects Non-Insulated Terminals Type Y Type YFN Maximum recommended operating temperature 150 °C (302 ° F) Extended barrel length assures a good quality crimp and makes crimping easier Brazed seam assures crimp reliability Internally beveled barrel for quick easy wire insertion Internal ba

立即下載

稀疏自編碼器初始化參數(shù)

input_nodes=8*8//輸入節(jié)點數(shù)
hidden_size=100//隱藏節(jié)點數(shù)
output_nodes=8*8//輸出節(jié)點數(shù)

稀疏自編碼器初始化訓練集數(shù)據(jù)

從mat文件中讀取圖像塊,隨機生成10000個8*8的圖像塊。

defsampleImage():
mat=scipy.io.loadmat('F:/ml/code/IMAGES.mat')
pic=mat['IMAGES']
shape=pic.shape
patchsize=8
numpatches=1000
patches=[]
i=np.random.randint(0,shape[0]-patchsize,numpatches)
j=np.random.randint(0,shape[1]-patchsize,numpatches)
k=np.random.randint(0,shape[2],numpatches)
forlinrange(numpatches):
temp=pic[i[l]:(i[l] patchsize),j[l]:(j[l] patchsize),k[l]]
temp=temp.reshape(patchsize*patchsize)
patches.append(temp)
returnpatches

稀疏自編碼器通過xvaier初始化第一層的權重值

defxvaier_init(input_size,output_size):
low=-np.sqrt(6.0/(input_nodes output_nodes))
high=-low
returntf.random_uniform((input_size,output_size),low,high,dtype=tf.float32)

稀疏自編碼器計算代價函數(shù)

代價函數(shù)由三部分組成,均方差項,權重衰減項,以及稀疏因子項。

defcomputecost(w,b,x,w1,b1):
p=0.1
beta=3
lamda=0.00001

hidden_output=tf.sigmoid(tf.matmul(x,w) b)
pj=tf.reduce_mean(hidden_output,0)
sparse_cost=tf.reduce_sum(p*tf.log(p/pj) (1-p)*tf.log((1-p)/(1-pj)))
output=tf.sigmoid(tf.matmul(hidden_output,w1) b1)
regular=lamda*(tf.reduce_sum(w*w) tf.reduce_sum(w1*w1))/2
cross_entropy=tf.reduce_mean(tf.pow(output-x,2))/2 sparse_cost*beta 
regular# regular sparse_cost*beta
returncross_entropy,hidden_output,output

稀疏自編碼器可視化自編碼器

為了使隱藏單元得到最大激勵(隱藏單元需要什么樣的特征輸入),將這些特征輸入顯示出來。

defshow_image(w):
sum=np.sqrt(np.sum(w**2,0))
changedw=w/sum
a,b=changedw.shape
c=np.sqrt(a*b)
d=int(np.sqrt(a))
e=int(c/d)
buf=1
newimage=-np.ones((buf (d buf)*e,buf (d buf)*e))
k=0
foriinrange(e):
forjinrange(e):
maxvalue=np.amax(changedw[:,k])
if(maxvalue<0):
maxvalue=-maxvalue
newimage[(buf i*(d buf)):(buf i*(d buf) d),(buf j*(d buf)):(buf j*(d buf) d)]=
np.reshape(changedw[:,k],(d,d))/maxvalue
k =1

plt.figure("beauty")
plt.imshow(newimage)
plt.axis('off')
plt.show()

稀疏自編碼器主函數(shù)

通過AdamOptimizer下降誤差,調節(jié)參數(shù)。

defmain():
w=tf.Variable(xvaier_init(input_nodes,hidden_size))
b=tf.Variable(tf.truncated_normal([hidden_size],0.1))
x=tf.placeholder(tf.float32,shape=[None,input_nodes])
w1=tf.Variable(tf.truncated_normal([hidden_size,input_nodes],-0.1,0.1))
b1=tf.Variable(tf.truncated_normal([output_nodes],0.1))
cost,hidden_output,output=computecost(w,b,x,w1,b1)
train_step=tf.train.AdamOptimizer().minimize(cost)
train_x=sampleImage()
sess=tf.Session()
sess.run(tf.global_variables_initializer())

foriinrange(100000):
_,hidden_output_,output_,cost_,w_=sess.run([train_step,hidden_output,output,cost,w],
feed_dict={x:train_x})
ifi00==0:
print(hidden_output_)
print(output_)
print(cost_)
np.save("weights1.npy",w_)
show_image(w_)
2100433B

SciPy相關推薦
  • 相關百科
  • 相關知識
  • 相關專欄