Skip to content

[WIP] Conv1x1#105

Draft
vmoens wants to merge 23 commits into
facebookincubator:mainfrom
vmoens:conv11
Draft

[WIP] Conv1x1#105
vmoens wants to merge 23 commits into
facebookincubator:mainfrom
vmoens:conv11

Conversation

@vmoens
Copy link
Copy Markdown
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
Copy Markdown
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