2017-08-23 1 views

Antwort

0

tf.nn.conv2d_transpose kann dies Upsampling tun (mit sorgfältiger Gestaltung von output_shape und strides). Ein Beispielcode:

import tensorflow as tf 
import numpy as np 

input = tf.convert_to_tensor(np.ones((1, 20, 20, 1))) 
input = tf.cast(input, tf.float32) 
b = np.zeros((3, 3, 1, 1)) 
b[1, 1, 0, 0] = 1 
weight = tf.convert_to_tensor(b) 
weight = tf.cast(weight, tf.float32) 
output = tf.nn.conv2d_transpose(input, weight, output_shape=(1, 40, 40, 1), strides=[1, 2, 2, 1]) 

sess = tf.Session() 

print sess.run(output[0, :, :, 0]) 

Ich glaube, die Überprüfung seiner API wird Ihnen mehr helfen.