我有一个用于深度学习分类器的输入数组,如下所示:
[[ a1, [b1,c1]
[d1,e1]
[f1,g1]]
[ a2, [b2,c2]
[d2,e2]
[f2,g2]]
[h2,i2]]
.......]
因此,每个集合都有一个浮点数和一个数组(N,2),其中每个集合的N都不相同。
在谷歌搜索时,我发现可以在input_shape值中输入多个尺寸,所以我尝试了:
input_shape=(1,(2,None)) /None means undefined size
我尝试更改订单,但无济于事。每次我将input_dim更改为input_shape时,都会:
TypeError: Error converting shape to a TensorShape: int() argument must be a string, a bytes-like object or a number, not 'tuple'.
我该如何定义输入暗淡?谢谢!
代码:
classifier = Sequential()
classifier.add(Dense(output_dim = 10, init = 'uniform', activation = 'relu', input_shape=(1,(2,None))))
classifier.add(Dense(output_dim = 10, init = 'uniform', activation = 'relu'))
classifier.add(Dense(output_dim = 1, init = 'uniform', activation = 'sigmoid'))
classifier.compile(optimizer = 'Adamax', loss = 'binary_crossentropy', metrics = ['accuracy'])
classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)