I'm trying to predict the winner of a race, when given 2 sets of features. The data looks like this:
array([[[ 1. ],
[ 1. ],
[ 0. ],
[ 0.10447761],
[ 0.18892762],
[ 0.76190472],
[ 1. ],
[ 0.0338983 ],
[ 1. ],
[ 0.41789967]],
[[ 1. ],
[ 1. ],
[ 0. ],
[ 0.10447761],
[ 0.18892762],
[ 0. ],
[ 0.74712646],
[ 0. ],
[ 0.44444448],
[ 0.53915548]],
....
The first 5 entries are features of racer #1 and entries 6-10 are the same features for racer #2. In addition, I have the results of the output neuron (0 or 1) which tells me which winner is expected to win.
I suggest the following model:
A 1D convolutional neural network with a kernel size of 5 and s stride size of 5. This is then followed by some flattening and fully connected layers. My results are very bad and I would like to know if there is conceptionally something wrong or if it's just the data.
My thoughts behind this is that it's like a convolution on an image, with a window size equivalent to the amount of features of each racer. On each of the two convolution, a filter set is then applied, which is equivalent for both of the two. The fully connected layer will then determine if the first or the second feature set is the one to be selected.
Any views if a convolutional layer can be used in that way are appreciated. Here the code snipped:
model = Sequential()
model.add(Conv1D(filters=64,
kernel_size=5,
strides=5,
input_shape=input_shape,
activation='relu'))
model.add(Dropout(0.2))
model.add(Flatten())
model.add(Dense(256, activation='relu', kernel_constraint=maxnorm(3)))
model.add(Dropout(0.2))
model.add(Dense(128, activation='relu', kernel_constraint=maxnorm(3)))
model.add(Dropout(0.2))
model.add(Dense(1, activation='softmax'))
model.compile(loss=sparse_categorical_crossentropy,
optimizer=Adam(),
metrics=['accuracy'])
model.fit(self.trainX,
self.trainY,
epochs=epochs,
batch_size=1,
verbose=1,
callbacks=[tbCallBack, early_stop])