-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
DL4J EmbeddingLayer includes bias but Keras Embedding does not #3118
Comments
@zheolong Are you loading this model for training or just inference (i.e., no further training, just making predictions)? If it's the latter, then you simply need to import the model with If you intend to train the model further, let us know: this may require changes to core DL4J, specifically the DL4J EmbeddingLayer. @eraly @AlexDBlack keep an eye on this as well. We might be able to handle this with FrozenLayer; if not, we need to have a chat about our embedding layer (and why we have a bias, which seems non-standard as far as I can tell). |
The latter situation, it works, thx |
@turambar the idea: our embedding layer is literally/mathematically identical to a dense layer with one-hot input. One option is to set bias LR to 0 (and if necessary, activation function to identity - not sure) to get something equivalent to Keras' implementation. |
@AlexDBlack Editing message -- I didn't read your response properly. Yeah, we can set the bias to zero and the learning rate to zero so that it doesn't change during training. That should work fine. |
this has been addressed through #3906 |
@turambar I actually like your idea better...
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
How can I fix this when loading keras model with hdf5 file.
The text was updated successfully, but these errors were encountered: