manastech/cafa5

Create a simple NN Conv1D taking sequences and binary classifying one term

Opened this issue · 0 comments

The first neural network that we should build should be a Conv1D network that takes as inputs

X_train = the one-hot encoded sequences of proteins we want to use for training
y_train = if they belong or not to a single term we want to build this classifier for (this will be a binary classifier)
X_val = the one-hot encoded sequences of proteins we want to use for validation
y_val = if they belong or not to that a single term

It should then create a keras model with parameterizable layers. The input_shape will be always (x, 20) being x the max protein length allowed (and 20 the size of the one-hot encoding vector per position) and the output layer should always have 2 classes (belongs to the term or not).

I.e. if we want to build this model:

        model = keras.Sequential()
        model.add(layers.Conv1D(32, kernel_size=3, activation='relu', input_shape=**(500,20)**))
        model.add(layers.Conv1D(64, kernel_size=3, activation='relu'))
        model.add(layers.Dropout(0.5))
        model.add(layers.MaxPooling1D(pool_size=2))
        model.add(layers.Flatten())
        model.add(layers.Dense(128, activation='relu'))
        model.add(layers.Dense(**2**, activation='softmax'))

we should pass as parameters a list of keras.layer objects to the class we're building and it will construct the model, but the first and last layer should be done by the constructor.