Tensor对象如何添加新图层?

时间:2019-03-07 05:11:13

标签: python tensorflow

我正在尝试使用googel宽深网,但是它存在一些问题。

#Wide part
wide = Sequential()
wide.add(Dense(1, input_dim=X_train.shape[1]))

#Deep part, Wide and Deep are keras.engine.sequential.Sequential
deep = Sequential()
deep.add(Dense(input_dim=X_train.shape[1], output_dim=100, activation='relu'))
deep.add(Dense(input_dim=100, output_dim=32, activation='relu'))
deep.add(Dense(input_dim=32, output_dim=8))
deep.add(Dense(1, activation='sigmoid'))
#merge the two part , and it changes to tensorflow.python.framework.ops.Tensor  
model = Sequential()
model = layers.Concatenate()([wide.output, deep.output]) 

#I want to add a dense layer to get one result,but it doesn't work anymore <br>
model.add(Dense(1, activation='sigmoid'))

the net and red circle is the problem 非常感谢,我该如何处理这个问题。

0 个答案:

没有答案
相关问题