第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

當我在 tensorflow 中實現(xiàn) unpool 時 tf.scatter_add

當我在 tensorflow 中實現(xiàn) unpool 時 tf.scatter_add

catspeake 2021-08-11 17:08:58
我正在嘗試使用 tf.scatter_add 在 tensorflow 中實現(xiàn) unpool,但我遇到了一個奇怪的錯誤,這是我的代碼:import tensorflow as tfimport numpy as npimport randomtf.reset_default_graph()mat = list(range(64))random.shuffle(mat)mat = np.array(mat)mat = np.reshape(mat, [1,8,8,1])M = tf.constant(mat, dtype=tf.float32)pool1, argmax1 = tf.nn.max_pool_with_argmax(M, ksize=[1,2,2,1], strides=[1,2,2,1], padding='SAME')pool2, argmax2 = tf.nn.max_pool_with_argmax(pool1, ksize=[1,2,2,1], strides=[1,2,2,1], padding='SAME')pool3, argmax3 = tf.nn.max_pool_with_argmax(pool2, ksize=[1,2,2,1], strides=[1,2,2,1], padding='SAME')輸出:[[ 0.  0.] [ 0. 63.]][[  0.   0.   0.   0.] [  0.   0.   0.   0.] [  0.   0. 126.   0.] [  0.   0.   0.   0.]][[  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0. 315.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.] [  0.   0.   0.   0.   0.   0.   0.   0.]]位置是對的,但價值是錯誤的。unpool2 是對的,unpool1 是期望值的兩倍,unpool2 是期望值的五倍。我不知道怎么了,誰能告訴我如何修復(fù)這個錯誤?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 218 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號