scanorset = scanorset.reshape((scanorset.shape[0], 1, scanorset.shape[1])) # ie, (24000, 1, 159)
clf1 = KerasRegressor(build_fn=cnnWEmbed, nb_epoch=20, batch_size=5, verbose=0)
clf1.fit(scanorset, targetsjoin)
and
def cnnWEmbed():
sequence_input = Input((1,159)) # also tried (159,1)
x = Conv1D(128, 5, activation='relu')(sequence_input)
x = MaxPooling1D(5)(x)
x = Conv1D(128, 5, activation='relu')(x)
x = MaxPooling1D(5)(x)
x = Conv1D(128, 5, activation='relu')(x)
x = MaxPooling1D(35)(x)
x = Flatten()(x)
x = Dense(128, activation='relu')(x)
preds = Dense(1)(x)
model = Model(sequence_input, preds)
model.compile(loss='mean_squared_error', optimizer='adam')
model.summary()
plot(model, to_file='cnnWEmbed.png', show_shapes=True)
return model
Best,
Pedro
Is it a problem with my topology?
How can I use a CNN with this data shape?
What would be the most appropriate networks/topologies for this type/shape of data?
Best regards,
Pedro
Best,