Skip to content

[WIP] Conv1x1 #105

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

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

[WIP] Conv1x1 #105

wants to merge 23 commits into from

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Apr 26, 2022

Motivation

Proposes a 1x1 convolution bijector.

Test Plan

from flowtorch.bijectors import Conv1x1Bijector
import torch


def test(LU_decompose, zero_init):
    c = Conv1x1Bijector(LU_decompose=LU_decompose, zero_init=zero_init)
    c = c(shape=torch.Size([10, 20, 20]))
    for p in c.parameters():
        p.data += torch.randn_like(p)/5

    x = torch.randn(1, 10, 20, 20)
    y = c.forward(x)
    yp = y.detach_from_flow()
    xp = c.inverse(yp)
    assert (xp/x-1).norm() < 1e-2

    assert (xp-x).norm()
    
for LU_decompose in (True, False):
    for zero_init in (True, False):
        test(True, True)

Important

This PR is branched out from the coupling layer. I'll update the branch once the review of the coupling layer is completed.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 26, 2022
@vmoens vmoens changed the title Convx11 [WIP] Convx11 Apr 26, 2022
@vmoens vmoens changed the title [WIP] Convx11 [WIP] Conv1x1 Apr 26, 2022
@vmoens vmoens marked this pull request as draft April 26, 2022 15:08
vmoens added 9 commits April 26, 2022 16:14
# Conflicts:
#	flowtorch/bijectors/__init__.py
#	flowtorch/bijectors/base.py
#	flowtorch/bijectors/compose.py
#	tests/test_bijector.py
@facebook-github-bot
Copy link
Contributor

Hi @vmoens!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants