【发布时间】:2019-04-25 20:12:12
【问题描述】:
我在 Lambda 层中进行了一些转换,现在我的形状为 (1,),我如何返回到 (None, 1)?
这是我的操作
def function_lambda(x):
import keras.backend
aux_array = keras.backend.sign(x)
#the shape is (?, 11) here OK
aux_array = keras.backend.relu(aux_array)
#the shape is (?, 11) here still OK
aux_array = keras.backend.any(aux_array)
#the shape is () here not OK
aux_array = keras.backend.reshape(aux_array, [-1])
#now the shape is (1,) almost OK
return aux_array
我如何重塑和放回None Batch Dimension?
【问题讨论】:
-
你弄明白了吗?
-
我想知道同样的问题。你弄明白了吗?
标签: python tensorflow keras reshape