jwr1995 / dc1d Goto Github PK
View Code? Open in Web Editor NEWA 1D implementation of a deformable convolutional layer in PyTorch with a few tricks.
License: MIT License
A 1D implementation of a deformable convolutional layer in PyTorch with a few tricks.
License: MIT License
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 ?
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.
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,
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.