MLBazaar / MLBazaar/MLPrimitives

Add primitive for Sequence classification with 1D convolutions

Open
#151 0 comments 0 reactions 1 assignee View on GitHub

@Hector-hedb12 is already working on this.

Since Apr 4, 2019.

approved new primitives
Dominant language
Python
Stars
70
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Related to #121

The architecture would be:

Conv1D (relu) ---> Conv1D (relu) --> MaxPooling1D --> 
  Conv1D (relu) ---> Conv1D (relu) --> GlobalAveragePooling1D --> Dropout -->
    Dense (sigmoid)

You can find an example of this here in the Sequence classification with 1D convolutions section:

from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.layers import Embedding
from keras.layers import Conv1D, GlobalAveragePooling1D, MaxPooling1D

seq_length = 64

model = Sequential()
model.add(Conv1D(64, 3, activation='relu', input_shape=(seq_length, 100)))
model.add(Conv1D(64, 3, activation='relu'))
model.add(MaxPooling1D(3))
model.add(Conv1D(128, 3, activation='relu'))
model.add(Conv1D(128, 3, activation='relu'))
model.add(GlobalAveragePooling1D())
model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))

model.compile(loss='binary_crossentropy',
              optimizer='rmsprop',
              metrics=['accuracy'])

model.fit(x_train, y_train, batch_size=16, epochs=10)
score = model.evaluate(x_test, y_test, batch_size=16)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.