Giter Site home page Giter Site logo

ada-conv-pytorch's People

Contributors

relbers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ada-conv-pytorch's Issues

Improved speed with batch adaconv?

Thanks for publishing this code! I've been tinkering around with AdaConv for months, and it's super helpful seeing somebody else's interpretation!

Something I've implemented in my code you might consider is applying the kernel convolutions in one go, by stacking all the channels together. Example:

    def forward(self, style_encoding: torch.Tensor, predicted: torch.Tensor, thumb_stats=None):
        N, c, h, w = predicted.size()
        depthwise = self.depthwise_kernel_conv(style_encoding)
        depthwise = depthwise.view(N*self.c_out, self.c_in // self.n_groups, 5, 5)
        s_d = self.pointwise_avg_pool(style_encoding)
        pointwise_kn = self.pw_cn_kn(s_d).view(N*self.c_out, self.c_out // self.n_groups, 1, 1)
        pointwise_bias = self.pw_cn_bias(s_d).view(N*self.c_out)

        if self.norm:
            predicted = F.instance_norm(predicted)

        predicted = predicted.view(1,N*C,h,w)
        content_out = nn.functional.conv2d(
                nn.functional.conv2d(self.pad(predicted),
                                     weight=depthwise,
                                     stride=1,
                                     groups=self.batch_groups
                                     ),
                stride=1,
                weight=pointwise_kn,
                bias=pointwise_bias,
                groups=self.batch_groups)
        content_out = content_out.permute([1, 0, 2, 3]).view(N,C,h,w)
        return content_out

I believe this achieves the same results without iteration.

train issue

TypeError: transfer_batch_to_device() takes 3 positional arguments but 4 were given

AdaConv with StyleGAN

Thanks for the authors' of this repo hard work.

I have a question about implementation of styleGAN2 with adaConv. Hope, somebody can help me understand how it is supposed to be implemented. StyleGAN2 takes style as a 1d vector, but adaconv requires the style to be an image (2d vector). Does the reshape of 1d style to an image is done at the beginning with replacement of Linear layers with Conv2d or layers aren't changed except for demodulation part, before which reshape is done every time?

On the implementation of pointwise convolution

Thanks for the authors' hard work of this code repository.

I have noticed that in current implementation, the pointwise convolution is also generated and viewed as group convolution (

nn.Conv2d(style_channels,
). For example, with input channel C_in and output channel C_out, the generated pointwise convolution is with size C_out x C_in/N_g x 1 x 1. However, according my understandig I wonder if the pointwise convolution should have the same size as a normal convolution kernel with size C_out x C_in x 1 x1 ?

Looking forward to your respose. Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.