{"id":13784335,"url":"https://github.com/ehoogeboom/convolution_exponential_and_sylvester","last_synced_at":"2025-05-11T19:32:52.663Z","repository":{"id":215846377,"uuid":"305875062","full_name":"ehoogeboom/convolution_exponential_and_sylvester","owner":"ehoogeboom","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-31T15:08:40.000Z","size":111,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-03T19:08:43.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehoogeboom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-21T01:25:48.000Z","updated_at":"2024-01-04T16:51:33.000Z","dependencies_parsed_at":"2024-01-17T03:13:40.601Z","dependency_job_id":"6f6d0ebd-75a7-4d17-bb60-177bfe0dd571","html_url":"https://github.com/ehoogeboom/convolution_exponential_and_sylvester","commit_stats":null,"previous_names":["ehoogeboom/convolution_exponential_and_sylvester"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehoogeboom%2Fconvolution_exponential_and_sylvester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehoogeboom%2Fconvolution_exponential_and_sylvester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehoogeboom%2Fconvolution_exponential_and_sylvester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehoogeboom%2Fconvolution_exponential_and_sylvester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehoogeboom","download_url":"https://codeload.github.com/ehoogeboom/convolution_exponential_and_sylvester/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225086612,"owners_count":17418763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:00:40.372Z","updated_at":"2024-11-17T20:31:52.358Z","avatar_url":"https://github.com/ehoogeboom.png","language":"Python","funding_links":[],"categories":["📝 Publications \u003csmall\u003e(60)\u003c/small\u003e"],"sub_categories":[],"readme":"### The Convolution Exponential and Generalized Sylvester Flows\n\n\n![Banner](https://github.com/ehoogeboom/convolution_exponential_and_sylvester/blob/main/visualizations/images/banner.png?raw=true)\n\n#### Example code.\n\nBelow an example of the implementation of the convolution exponential.\nNote the very cool property that inv_conv_exp is computed by simply negating\nthe kernel. For more detailed code see [here](https://github.com/ehoogeboom/convolution_exponential_and_sylvester/blob/main/models/transformations/convexp/functional.py#L42).\n\n```python\nimport torch.nn.functional as F\n\n\ndef conv_exp(input, kernel, terms=10):\n    B, C, H, W = input.size()\n\n    result = input\n    product = input\n\n    for i in range(1, terms + 1):\n        product = F.conv2d(product, kernel, padding=1, stride=(1, 1)) / i\n        result = result + product\n\n    return result\n\n\ndef inv_conv_exp(input, kernel, terms=10):\n    return conv_exp(input, -kernel, terms)\n```\n\n\n\n#### Abstract\nThis paper introduces a new method to build linear flows,\nby taking the exponential of a linear transformation.\nThis linear transformation does not need to be invertible itself,\nand the exponential has the following desirable properties: it is\nguaranteed to be invertible, its inverse is straightforward to\ncompute and the log Jacobian determinant is equal to the trace of\nthe linear transformation. An important insight is that the\nexponential can be computed implicitly, which allows the use of\nconvolutional layers. Using this insight, we develop new invertible\ntransformations named convolution exponentials and graph convolution\nexponentials, which retain the equivariance of their underlying\ntransformations. In addition, we generalize Sylvester Flows and\npropose Convolutional Sylvester Flows which are based on the\ngeneralization and the convolution exponential as basis change.\nEmpirically, we show that the convolution exponential outperforms\nother linear transformations in generative flows on CIFAR10 and the\ngraph convolution exponential improves the performance of graph\nnormalizing flows. In addition, we show that Convolutional Sylvester\nFlows improve performance over residual flows as a generative flow\nmodel measured in log-likelihood.\n\n#### Experiments\nThe commands below reproduce the results for the mixing experiments:\n```\npython main_experiment.py --n_levels 2 --densenet_depth 8 --n_subflows 10 --densenet_growth 64 --n_intermediate_channels 64 --use_splitprior --dequantize_distribution flow --use_gated_conv --epochs 1000 --exp_name 'conv1x1' --mixing '1x1'\n```\n\n```\npython main_experiment.py --n_levels 2 --densenet_depth 8 --n_subflows 10 --densenet_growth 63 --n_intermediate_channels 64 --use_splitprior --dequantize_distribution flow --use_gated_conv --epochs 1000 --exp_name 'convexp' --mixing 'convexp'\n```\n\n```\npython main_experiment.py --n_levels 2 --densenet_depth 8 --n_subflows 10 --densenet_growth 63 --n_intermediate_channels 64 --use_splitprior --dequantize_distribution flow --use_gated_conv --epochs 1000 --exp_name 'emerging' --mixing 'emerging'\n```\n\n```\npython main_experiment.py --n_levels 2 --densenet_depth 8 --n_subflows 10 --densenet_growth 63 --n_intermediate_channels 64 --use_splitprior --dequantize_distribution flow --use_gated_conv --epochs 1000 --exp_name 'woodbury' --mixing 'woodbury'\n```\n\nThe Commands below reproduce the results for the residual transformations experiment:\n\nConv. Sylvester Flow (var. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_internal_channels 528 --use_splitprior --dequantize_distribution flow --epochs 1000 --exp_name 'sylvester' --model_type sylvester\n```\n\nConv. Sylvester Flow (unif. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_internal_channels 528 --use_splitprior --dequantize_distribution uniform --epochs 1000 --exp_name 'sylvester' --model_type sylvester\n```\n\nResidual Block Flow (var. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution flow --epochs 1000 --exp_name 'residualflow' --model_type residual_flow\n```\n\nResidual Block Flow (unif. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution uniform --epochs 1000 --exp_name 'residualflow' --model_type residual_flow\n```\n\nBaseline Coupling Flow (var. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution flow --epochs 1000 --exp_name 'coupling' --model_type coupling_flow\n```\n\nBaseline Coupling Flow (unif. deq.):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 16 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution uniform --epochs 1000 --exp_name 'coupling' --model_type coupling_flow\n```\n\n\nResidual Block Flow (var. deq.) (equal memory):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 8 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution flow --epochs 1000 --exp_name 'residualflow' --model_type residual_flow\n```\n\nResidual Block Flow (unif. deq.) (equal memory):\n```\npython experiment_sylvester_network.py --n_levels 3 --n_subflows 8 --n_intermediate_channels 528 --use_splitprior --dequantize_distribution uniform --epochs 1000 --exp_name 'residualflow' --model_type residual_flow\n```\n\n\n#### Acknowledgements\nThe Robert Bosch GmbH is acknowledged for financial support.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehoogeboom%2Fconvolution_exponential_and_sylvester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehoogeboom%2Fconvolution_exponential_and_sylvester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehoogeboom%2Fconvolution_exponential_and_sylvester/lists"}