question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add HOWTO: Circular Convs

See original GitHub issue

XLA convs natively do not support this, but you can always manually concat a kernel/2 per dim amount of data on the edges to achieve it at some data layout cost.

A minimal example in terms of default Linen nn.Conv and jnp.pad:

class CircularConv(nn.Module):
  features: int
  kernel_size: Union[int, Iterable[int]]
  @nn.compact
  def __call__(self, inputs):
    padding = [(0, 0)] + [(k//2, k//2) for k in self.kernel_size] + [(0, 0)]
    inputs = jnp.pad(inputs, padding, mode='wrap')
    return nn.Conv(self.features, self.kernel_size, padding='VALID')(inputs)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
marcvanzeecommented, Feb 1, 2021

@VolodyaCO interesting suggestion! If you think this would be generally useful, could you create a feature request issue proposing this?

0reactions
marcvanzeecommented, Apr 28, 2022

Closing this since @sgrigory implemented circular padding in #1661. Thanks @sgrigory!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing Twitter Circle, a new way to Tweet to a smaller crowd
With Twitter Circle, people now have the flexibility to choose who can see and engage with their content on a Tweet-by-Tweet basis.
Read more >
Circular Convolution with and without using conv in matlab
In this video i am going to explain and implement circular convolution code in matlab with and without using conv,cconv/standard function .
Read more >
Linear and Circular Convolution - MATLAB & Simulink
This example shows how to establish an equivalence between linear and circular convolution. Linear and circular convolution are fundamentally different ...
Read more >
How To Type Text In A Circle In Photoshop (Step By Step)
To type text in a circle in Photoshop, select the Ellipse Tool then click and drag out on your canvas to create a...
Read more >
Use Messages on your iPhone or iPad - Apple Support
Pin your conversations. And learn how to edit or undo messages. ... Or tap the image circle to choose an image, photo, emoji,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found