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

Libnd4j: conv2d op: switch to single weights format #6393

Closed
AlexDBlack opened this Issue Sep 7, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@AlexDBlack
Copy link
Member

AlexDBlack commented Sep 7, 2018

Following on from the discussion in slack: Our libnd4j conv2d op weights format depend on the activations input format (NCHW vs. NHWC).
https://github.com/deeplearning4j/deeplearning4j/blob/master/libnd4j/include/ops/declarable/generic/convo/conv2d.cpp#L40

However, for TF import, we require weights in [kH, kW, inC, outC] for both cases.
In principle, we could transpose weights on import - but after considering this, it seems too brittle (too many edge cases).

Instead, let's change the weights format for conv2d to always be [kH, kW, inC, outC] regardles of the input format.

Note DL4J uses [outC, inC, kH, kW] but we'll handle that at the Java/DL4J level via permute when we use conv2d op.
There's also the question of performance vs. weight layout, but let's leave that question for another time, as that will require extensive testing.

@lock

This comment has been minimized.

Copy link

lock bot commented Oct 12, 2018

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.

@lock lock bot locked and limited conversation to collaborators Oct 12, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.