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.

redefine 1D `self.N`, deprecate`self.J_pad`?

See original GitHub issue

in 1D, self.N is the unpadded length of the input signal. It is defined in ScatteringBase1D as some derivative of self.shape and isn’t being used anywhere else.

Same for 2D where self.shape unpacks as self.M, self.N.

I see no reason to keep these values as attributes in the object when:

  • we have self.shape for that
  • these values are only being used transiently, in self.build()
  • our filterbank construction relies on N_padded, not N
  • these values are trivially available in the forward via self.N = len(x)

In the spirit of preparing for scattering on variable-length inputs (shape=None, a long-requested feature !), i ask the permission to remove these attributes from self.

I am open to making a deprecation cycle where we convert these attributes to read-only properties and print a DeprecationWarning in v0.3 if anyone tries to access these numbers (NB: none of our examples access self.N and friends)

@janden @eickenberg

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
jandencommented, Jun 14, 2022

Might be good to rename it to something like _N_padded, though to make clear it’s the padded size that’s intended.

1reaction
jandencommented, Jun 13, 2022

But why even keep the N attribute? The padded size is, in a sense, an internal parameter for the implementation. Why do we need to expose it to the user at all?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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