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

FIX: Condition that check if channel need to be swapped #101

Merged
merged 1 commit into from
Sep 15, 2018
Merged

FIX: Condition that check if channel need to be swapped #101

merged 1 commit into from
Sep 15, 2018

Conversation

PrimozGodec
Copy link
Contributor

@PrimozGodec PrimozGodec commented Mar 20, 2018

Issue

seed_input can have a shape with unknown values, e.g. [1, None, None, 3] in the channel_last case. That causes the fixed condition is False and representation changes from channel_last to channel_first and vice-versa.

Fix

Condition fixed to check only whether the channel is channel_last or channel_first. One of condition always keeps when the same representation.

@PrimozGodec
Copy link
Contributor Author

#90

@PrimozGodec
Copy link
Contributor Author

@raghakot can you consider this pull request. Unitests are failing due to previous bugs.

vis/optimizer.py Outdated
@@ -93,7 +93,8 @@ def _get_seed_input(self, seed_input):
seed_input = np.expand_dims(seed_input, 0)

# Only possible if channel idx is out of place.
if seed_input.shape != desired_shape:
if seed_input.shape[3] != desired_shape[3] and \
Copy link
Owner

Choose a reason for hiding this comment

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

better to use shape[-1] since the input could be n-dim tensor. looks good otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed. @raghakot do you have an idea how to fix the unit-test issues.

@keisen keisen requested a review from raghakot September 1, 2018 06:38
@raghakot raghakot merged commit 668b0e1 into raghakot:master Sep 15, 2018
@PrimozGodec PrimozGodec deleted the fix-dimensions branch September 15, 2018 09:27
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