-
Notifications
You must be signed in to change notification settings - Fork 36
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
Demo or example code #5
Comments
Okay I already see at least one thing wrong here. I was imagining hooking up the last time-step's output from the RNN to a vanilla Dense network. Does that make sense? Or does this implementation depend on the output vector having the same time dimension as the input? |
Yeah if return_sequences=False, then you do want a Dense network, not a TimeDistributedDense. I think the issue is with your input_shape argument. You mention that X_train is of the shape (60000, 196, 1, 15, 15). If that's the case, then your input_shape to the first TimeDistributedConvolution2D layer should be input_shape=(196,1, 15, 15). Also, as a sanity check what version of Keras are you using? I can only guarantee support for version 0.3.0 and lower. |
Yep, I'm using 0.3.0. Yeah the input shape was the issue - I was focused on the error and not really checking the code. It seems to be working now. I'll post a link with the working code and then close the issue. Thanks |
https://github.com/jamesmf/mnistCRNN Above is a working TimeDistributedConvolution Example. It takes a set of MNIST images and learns to predict their sum. |
Great thanks! I added the link to your demo in the ReadMe :) 👍 |
Is there example code anywhere? This is an exciting addition to keras, and I'd love to see it in action. I attempted to adapt your 'untested' code snippet from
keras-team/keras#401
but had trouble going from the TimeDistributedFlatten to the LSTM layers.
That yields the following dimension mismatch:
Inputs shapes: [(32, 392), (1568, 256)]
My test case is simply processing windows within MNIST images sequentially. My window size is (15,15) resulting in 196 windows.
The shape of X_train is
(60000, 196, 1, 15, 15)
If I instead try
return_sequences = True
in the RNN layer, I getAssertionError: Incompatible shapes: layer expected input with ndim=2 but previous layer has output_shape (None, 196, 256)
Is there an example anywhere that I could use to troubleshoot?
Thanks
The text was updated successfully, but these errors were encountered: