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

Make InputLayer support masking #10794

Merged
merged 3 commits into from
Jul 30, 2018
Merged

Conversation

yanboliang
Copy link
Contributor

@yanboliang yanboliang commented Jul 27, 2018

Summary

Sequential adds InputLayer automatically if users don't assign. When Sequential was placed as downstream of Masking layer(#10763), even if all users explicitly added layers in Sequential support masking, it still throws exception due to InputLayer doesn't support masking.
I think InputLayer should support masking and it can use the default compute_mask function in base layer(just carry over the input mask). Because users don't add this layer explicitly, it should transparent to users.

Related Issues

#10763

PR Overview

  • This PR requires new unit tests [y/n] (make sure tests are included)
  • This PR requires to update the documentation [y/n] (make sure the docs are up-to-date)
  • This PR is backwards compatible [y/n]
  • This PR changes the current API [y/n] (all API changes need to be approved by fchollet)

@yanboliang yanboliang mentioned this pull request Jul 27, 2018
2 tasks
Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

@@ -4,7 +4,7 @@

from keras import backend as K
from keras import layers
from keras.models import Model
from keras.models import Model, Sequential
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One import per line

@keras_test
def test_sequential_as_downstream_of_masking_layer():

input = layers.Input(shape=(3, 4))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input is a reserved Python keyword, use inputs

Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@fchollet fchollet merged commit ee02d25 into keras-team:master Jul 30, 2018
@yanboliang yanboliang deleted the input-masking branch July 30, 2018 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants