Skip to content

Commit

Permalink
Merge pull request #113 from danielskatz/patch-1
Browse files Browse the repository at this point in the history
minor changes in JOSS paper
  • Loading branch information
rafaelorozco authored Jul 30, 2024
2 parents d365ed0 + 303fdd4 commit bc75992
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions docs/paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @misc{NormalizingFlows.jl
@inproceedings{fjelde2020bijectors,
title={Bijectors. jl: Flexible transformations for probability distributions},
author={Fjelde, Tor Erlend and Xu, Kai and Tarek, Mohamed and Yalburgi, Sharan and Ge, Hong},
booktitle={Symposium on Advances in Approximate Bayesian Inference},
booktitle={Symposium on Advances in Approximate {B}ayesian Inference},
pages={1--17},
year={2020},
organization={PMLR}
Expand Down Expand Up @@ -133,7 +133,7 @@ @software{frames_white_2023_10100624

@software{freia,
author = {Ardizzone, Lynton and Bungert, Till and Draxler, Felix and Köthe, Ullrich and Kruse, Jakob and Schmier, Robert and Sorrenson, Peter},
title = {{Framework for Easily Invertible Architectures (FrEIA)}},
title = {Framework for Easily Invertible Architectures ({FrEIA})},
year = {2018-2022},
url = {https://github.com/vislearn/FrEIA}
}
Expand All @@ -155,7 +155,7 @@ @software{nflows


@article{paszke2019pytorch,
title={Pytorch: An imperative style, high-performance deep learning library},
title={Py{T}orch: An imperative style, high-performance deep learning library},
author={Paszke, Adam and Gross, Sam and Massa, Francisco and Lerer, Adam and Bradbury, James and Chanan, Gregory and Killeen, Trevor and Lin, Zeming and Gimelshein, Natalia and Antiga, Luca and others},
journal={Advances in neural information processing systems},
volume={32},
Expand Down Expand Up @@ -200,7 +200,7 @@ @article{lensink2022fully
}

@inproceedings{kruse2021hint,
title={HINT: Hierarchical invertible neural transport for density estimation and Bayesian inference},
title={HINT: Hierarchical invertible neural transport for density estimation and {B}ayesian inference},
author={Kruse, Jakob and Detommaso, Gianluca and K{\"o}the, Ullrich and Scheichl, Robert},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={35},
Expand Down Expand Up @@ -255,7 +255,7 @@ @article{siahkoohi2021preconditioned
}

@article{siahkoohi2022wave,
title={Wave-equation-based inversion with amortized variational Bayesian inference},
title={Wave-equation-based inversion with amortized variational {B}ayesian inference},
author={Siahkoohi, Ali and Orozco, Rafael and Rizzuti, Gabrio and Herrmann, Felix J},
journal={arXiv preprint arXiv:2203.15881},
doi={10.48550/arXiv.2203.15881},
Expand Down Expand Up @@ -330,7 +330,7 @@ @article{orozco2023amortized
}

@inproceedings{orozco2023adjoint,
title={Adjoint operators enable fast and amortized machine learning based Bayesian uncertainty quantification},
title={Adjoint operators enable fast and amortized machine learning based {B}ayesian uncertainty quantification},
author={Orozco, Rafael and Siahkoohi, Ali and Rizzuti, Gabrio and van Leeuwen, Tristan and Herrmann, Felix J},
booktitle={Medical Imaging 2023: Image Processing},
volume={12464},
Expand All @@ -341,7 +341,7 @@ @inproceedings{orozco2023adjoint
}

@article{khorashadizadeh2023conditional,
title={Conditional injective flows for Bayesian imaging},
title={Conditional injective flows for {B}ayesian imaging},
author={Khorashadizadeh, AmirEhsan and Kothari, Konik and Salsi, Leonardo and Harandi, Ali Aghababaei and de Hoop, Maarten and Dokmani{\'c}, Ivan},
journal={IEEE Transactions on Computational Imaging},
volume={9},
Expand Down
8 changes: 4 additions & 4 deletions docs/paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The package we present, InvertibleNetworks.jl, is a pure Julia [@bezanson2017jul
# Statement of need


This software package focuses on memory efficiency. The promise of neural networks is in learning high-dimensional distributions from data thus normalizing flow packages should allow application to large dimensional inputs such as images or 3D volumes. Interestingly, the invertibility of normalizing flows naturally alleviates memory concerns since intermediate network activations can be recomputed instead of saved in memory. This greatly reduces the memory needed during backpropagation. The problem is that directly implementing normalizing flows in automatic differentiation frameworks such as PyTorch [@paszke2019pytorch] will not automatically exploit this invertibility. The available packages for normalizing flows such as Bijectors.jl [@fjelde2020bijectors], NormalizingFlows.jl [@NormalizingFlows.jl], nflows [@nflows], normflows [@stimper2023normflows] and FrEIA [@freia] are built depending on automatic differentiation frameworks and thus do not exploit invertibility for memory efficiently.
This software package focuses on memory efficiency. The promise of neural networks is in learning high-dimensional distributions from data thus normalizing flow packages should allow application to large dimensional inputs such as images or 3D volumes. Interestingly, the invertibility of normalizing flows naturally alleviates memory concerns since intermediate network activations can be recomputed instead of saved in memory. This greatly reduces the memory needed during backpropagation. The problem is that directly implementing normalizing flows in automatic differentiation frameworks such as PyTorch [@paszke2019pytorch] will not automatically exploit this invertibility. The available packages for normalizing flows such as Bijectors.jl [@fjelde2020bijectors], NormalizingFlows.jl [@NormalizingFlows.jl], nflows [@nflows], normflows [@stimper2023normflows], and FrEIA [@freia] are built depending on automatic differentiation frameworks and thus do not exploit invertibility for memory efficiently.

We chose to write this package in Julia since it was built with a commitment to facilitate interoperability with other packages for workflows in scientific machine learning [@louboutin2022accelerating]. The interoperability was facilitated by the multiple dispatch system of Julia. Our goal is to provide solutions for imaging problems with high degrees of freedom, where computational speed is crucial. We have found that this software significantly benefits from Julia's Just-In-Time compilation technology.

Expand All @@ -57,7 +57,7 @@ By implementing gradients by hand, instead of depending completely on automatic
![Our InvertibleNetworks.jl package provides memory frugal implementations of normalizing flows. Here, we compare our implementation of GLOW with an equivalent implementation in a PyTorch package. Using a 40GB A100 GPU, the PyTorch package can not train on image sizes larger than 480x480, while our package can handle sizes larger than 1024x1024.
\label{fig:memory}](./figs/mem_used_new.png)

In \autoref{fig:memory}, we show the relation between input size and the memory required for a gradient calculation in a PyTorch normalizing flow package (normflows [@stimper2023normflows]) as compared to our package. The two tests were run with identical normalizing flow architectures. We note that the PyTorch implementation quickly increases the memory load and throws an out-of-memory error on the 40GB A100 GPU at a spatial image size of 480x480, while our InvertibleNetworks.jl implementation still has not run out of memory at spatial size 1024x1024. Note that this is in the context of a typical learning routine, so the images include 3 channels (RGB) and we used a batch size of 8.
In \autoref{fig:memory}, we show the relation between input size and the memory required for a gradient calculation in a PyTorch normalizing flow package (normflows [@stimper2023normflows]) as compared to our package. The two tests were run with identical normalizing flow architectures. We note that the PyTorch implementation quickly increases the memory load and throws an out-of-memory error on the 40-GB A100 GPU at a spatial image size of 480x480, while our InvertibleNetworks.jl implementation still has not run out of memory at spatial size 1024x1024. Note that this is in the context of a typical learning routine, so the images include 3 channels (RGB) and we used a batch size of 8.

![Due to the invertibility of the normalizing flow architecture, the memory consumption does not increase as we increase the depth of the network. Our package properly exploits this property and thus shows constant memory consumption, whereas the PyTorch package does not.
\label{fig:memory-depth}](./figs/mem_used_new_depth.png)
Expand All @@ -69,10 +69,10 @@ Although the normalizing flow layer gradients are hand-written, the package is f

All implemented layers are tested for invertibility and correctness of their gradients with continuous integration testing via GitHub actions. There are many examples for layers, networks and application workflows allowing new users to quickly build networks for a variety of applications. The ease of use is demonstrated by the publications that made use of the package.

Many publications have used InvertibleNetworks.jl for diverse applications including change point detection, [@peters2022point], acoustic data denoising [@kumar2021enabling], seismic imaging [@rizzuti2020parameterizing; @siahkoohi2021preconditioned; @siahkoohi2022wave;@siahkoohi2023reliable; @louboutin2023learned;@alemohammad2023self], fluid flow dynamics [@yin2023solving], medical imaging [@orozco2023adjoint;@orozco2023amortized; @orozco2021photoacoustic;@orozco2023refining] and monitoring CO2 for combating climate change [@gahlot2023inference].
Many publications have used InvertibleNetworks.jl for diverse applications including change point detection, [@peters2022point], acoustic data denoising [@kumar2021enabling], seismic imaging [@rizzuti2020parameterizing; @siahkoohi2021preconditioned; @siahkoohi2022wave;@siahkoohi2023reliable; @louboutin2023learned;@alemohammad2023self], fluid flow dynamics [@yin2023solving], medical imaging [@orozco2023adjoint;@orozco2023amortized; @orozco2021photoacoustic;@orozco2023refining], and monitoring CO2 for combating climate change [@gahlot2023inference].

# Future work
The neural network primitives (convolutions, non-linearities, pooling etc) are implemented in NNlib.jl abstractions, thus support for AMD, Intel and Apple GPUs can be trivially extended. Also, while our package can currently handle 3D inputs and has been used on large volume-based medical imaging [@orozco2022memory], there are interesting avenues of research regarding the "channel explosion" seen in invertible down and upsampling used in invertible networks [@peters2019symmetric].
The neural network primitives (convolutions, non-linearities, pooling etc) are implemented in NNlib.jl abstractions, thus support for AMD, Intel, and Apple GPUs can be trivially extended. Also, while our package can currently handle 3D inputs and has been used on large volume-based medical imaging [@orozco2022memory], there are interesting avenues of research regarding the "channel explosion" seen in invertible down and upsampling used in invertible networks [@peters2019symmetric].


# References
Expand Down

0 comments on commit bc75992

Please sign in to comment.