Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for a convnet/pooling model #17

Closed
wpm opened this issue Jul 15, 2017 · 3 comments
Closed

Add support for a convnet/pooling model #17

wpm opened this issue Jul 15, 2017 · 3 comments
Assignees
Milestone

Comments

@wpm
Copy link
Owner

wpm commented Jul 15, 2017

Another kind of neural model for sequences.

@wpm wpm self-assigned this Jul 15, 2017
@wpm
Copy link
Owner Author

wpm commented Jul 20, 2017

See

Section 3.1 of Kim's paper describes his hyper-parameters. He also uses l2 regularization.

@wpm wpm added this to the Release 1.1.0 milestone Jul 21, 2017
@wpm
Copy link
Owner Author

wpm commented Jul 26, 2017

From the Keras Slack Channel

Me

I'm trying to repro an experiment in which someone used a 1d convnet/maxpooling strategy over words in a sentence. (Yoon Kim, 2014, "Convolutional Neural Networks for Sentence Classification") In that experiment the convolution filters represent sliding windows over consecutive tokens. They ran a model with window sizes 3, 4, and 5.

How would I build an equivalent model with multiple window sizes in Keras? Do I have my input feed into three different Conv1D layers (or pairs of Conv1D and MaxPooling1D layers) with different kernel_size values and then concatenate the results into a single vector?

dref306

yup

@wpm
Copy link
Owner Author

wpm commented Jul 26, 2017

A model that isn't working right now.

Convolutional text sequence classifier: 2 labels, 100 filters, kernel size 3, pool factor 4, dropout rate 0.50
Text sequence embedder: core_web_sm, embedding matrix (20000, 300)

_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
embedding (Embedding)        (None, 22, 300)           6000000   
_________________________________________________________________
convolution (Conv1D)         (None, 20, 100)           90100     
_________________________________________________________________
pooling (MaxPooling1D)       (None, 5, 100)            0         
_________________________________________________________________
softmax (Dense)              (None, 5, 2)              202       
_________________________________________________________________
dropout (Dropout)            (None, 5, 2)              0         
=================================================================
Total params: 6,090,302.0
Trainable params: 90,302.0
Non-trainable params: 6,000,000.0
_________________________________________________________________

wpm added a commit that referenced this issue Jul 26, 2017
This is a model with the topology described in Yoon Kim 2014.

This addresses #17.
@wpm wpm closed this as completed Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant