Coder Social home page Coder Social logo

jwr1995 / dc1d Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 4.0 100 KB

A 1D implementation of a deformable convolutional layer in PyTorch with a few tricks.

License: MIT License

Python 100.00%
convolutional-layers convolutional-neural-networks deep-learning pytorch

dc1d's People

Contributors

jwr1995 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

Watchers

 avatar  avatar

dc1d's Issues

1D kernels using deform_conv2d

Hi,

wouldn't it have been way easier to write the deform_conv1d as a small wrapper around deform_conv2d() in which you "unsqueeze()" the 1D input (and kernal dims) and pass zeros() for the offset channel corresponding to the unsqueezed (fabricated) dimension ?

How to embed DeformConv1d into another model?

I would like to embed your DeformConv1d model into my deep learning model as follows:

class MyModel():
init
DeformConv1d
Conv1d
...

forward(x)
x =DeformConv1d(x)
x=Conv1d(x)
...

Given that the learnable offsets, represented using 'nn.Parameter', are located outside the DeformConv1d class, I am encountering difficulties in incorporating the DeformConv1d into my model.
Could you please provide guidance on how to achieve this?
An illustrative code example would be greatly appreciated.

Error in running the DeformConv1d

Hi,

I used the provided functions, and tried to run the sample code in the README.md.
But I got this error that the length of input and output are different.

_**assert in_shape[-1] == output.shape[-1], f"input length {in_shape[-1]} and output length {output.shape[-1]} do not match."

AssertionError: input length 128 and output length 83 do not match.**_

Thanks,

The offset in deformable conv

Great job!
I found that the deformconv1d in this repo is different from the original one. If I'm right, the deformable kernel will not change when facing different inputs. Since the offsets are set as the learnable parameters, which will be fixed after the training, all samples will use the same offset parameters to conduct the deformable 1d convolution. While the original deformable conv can change the form of the kernel based on the input samples.

Is that correct?

How to learn offsets in 1D Convolution?

Hello! It is used Conv2d layer for learning offset 2D deformable convolution. In readme example you use such way to declare params:

offsets = nn.Parameter(torch.ones(batch_size, 1, output_length, kernel_size, requires_grad=True))
But how we can learn offsets for current input sequence x? Can you give some example?

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.