You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way of performing dynamic pooling in Keras? (1D CNN)
Like Goldberg elaborates: Splitting the resulting output from the convolution (conv layer) into r groups, thus apply pooling separately on each group, where the groups can be of different sizes.
Or is there a way of performing variable-size pooling?
Example:
Given a text of sentences, text = [sentence1, sentence2, sentence3], where sentence1 is of length 20, sentence2 of length 15, and sentence3 of length 18 (counted in words).
Is there a way of grouping the convolution associated with the words from sentence1, sentence2, and sentence3? Thus apply pooling at each group.
...
conv = Conv1D(filters=100 kernel_size=2, strides=1, padding="valid", activation="relu")(training)
pool_0 = MaxPooling1D(pool_size=20, stride=20)(conv[0])
pool_1 = MaxPooling1D(pool_size=15, stride=15)(conv[1])
pool_2 = MaxPooling1D(pool_size=18, stride=18)(conv[2])
traning = concatenate([pool_0, pool_1, pool_2)
...
Or performing variable-size pooling, a structure like:
...
conv = Conv1D(filters=100 kernel_size=2, strides=1, padding="valid", activation="relu")(training)
pool = MaxPooling1D(pool_size=[20, 15, 18], stride=[20, 15, 18])(conv)
traning = concatenate([pool[0], pool[1], pool[2])
...
Thanks.
The text was updated successfully, but these errors were encountered:
Is there a way of performing dynamic pooling in Keras? (1D CNN)
Like Goldberg elaborates: Splitting the resulting output from the convolution (conv layer) into r groups, thus apply pooling separately on each group, where the groups can be of different sizes.
Or is there a way of performing variable-size pooling?
Example:
Given a text of sentences, text = [sentence1, sentence2, sentence3], where sentence1 is of length 20, sentence2 of length 15, and sentence3 of length 18 (counted in words).
Is there a way of grouping the convolution associated with the words from sentence1, sentence2, and sentence3? Thus apply pooling at each group.
...
conv = Conv1D(filters=100 kernel_size=2, strides=1, padding="valid", activation="relu")(training)
pool_0 = MaxPooling1D(pool_size=20, stride=20)(conv[0])
pool_1 = MaxPooling1D(pool_size=15, stride=15)(conv[1])
pool_2 = MaxPooling1D(pool_size=18, stride=18)(conv[2])
traning = concatenate([pool_0, pool_1, pool_2)
...
Or performing variable-size pooling, a structure like:
...
conv = Conv1D(filters=100 kernel_size=2, strides=1, padding="valid", activation="relu")(training)
pool = MaxPooling1D(pool_size=[20, 15, 18], stride=[20, 15, 18])(conv)
traning = concatenate([pool[0], pool[1], pool[2])
...
Thanks.
The text was updated successfully, but these errors were encountered: