slimgroup / InvertibleNetworks.jl

A Julia framework for invertible neural networks
MIT License
152 stars 23 forks source link

Fix dimension check in squeeze, #43

Closed rafaelorozco closed 2 years ago

rafaelorozco commented 2 years ago

Fixing the check in unsqueeze. It was checking that all spatial dimensions are divisible by two when it should check that channel dimension is divisible by 4 (or 8 if 5D tensor).

This was preventing squeeze and unsqueeze with sizes likes (10,10,1,1) which gets squeezed to (5,5,4,1) and then it couldnt get unsqueezed.

Added some relevant documentation and a test.

codecov[bot] commented 2 years ago

Codecov Report

Merging #43 (d95e5ce) into master (e4a2c97) will not change coverage. The diff coverage is 50.00%.

:exclamation: Current head d95e5ce differs from pull request most recent head cb489cc. Consider uploading reports for the commit cb489cc to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##           master      #43   +/-   ##
=======================================
  Coverage   85.94%   85.94%           
=======================================
  Files          31       31           
  Lines        2511     2511           
=======================================
  Hits         2158     2158           
  Misses        353      353           
Impacted Files Coverage Δ
src/utils/dimensionality_operations.jl 94.57% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e4a2c97...cb489cc. Read the comment docs.