Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Fixes for initializers/convaware.py #505

Closed

Conversation

torzdf
Copy link

@torzdf torzdf commented Jul 12, 2019

This PR fixes 3 issues in initializers/convaware.py:

  • Fixes the transpose on rank == 4 to correctly return column and row in the correct order (re: Issue ConvolutionAware error #479)
  • Respect passed in dtype to __call__ (as per it's parent class) rather than relying on K.floatx()
  • Correctly return a K.variable() of the correct dtype rather than a numpy array of dtype K.floatx()

Verification

  • This PR can be verified by initializing a conv2D layer with the ConvolutionAware initializer. As per issue ConvolutionAware error #479, it will fail if run from the old code but succeed with this PR.
  • Additionally, if wrapping this code in another initializer (for example an ICNR initializer) with a different dtype to that stored in K.floatx(), this PR will succeed where the original code will fail.
  • Finally, the original code will fail if wrapping this initializer inside another initializer (eg. ICNR) using Tensorflow backend as the returned numpy array forces a tensorflow Channel Order error. By returning a K.variable() from this initializer, that error is avoided.

This pull request fixes #479

@torzdf torzdf closed this Jun 15, 2022
@torzdf torzdf deleted the convolutional_aware_initializer branch June 15, 2022 22:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConvolutionAware error
1 participant