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.

make core algorithm a self.variable.

See original GitHub issue

Currently in each specific deep learning framework’s frontend we import from core the ScatteringnD algorithm and call it.

It would be a nice change for power users if we instead imported the algorithm in the base frontend and defined a variable to contain the call i.e. self.scatteringalgo = scatteringnd. then in each specific frontend, the call to the algorithm would be given by self.scatteringalgo. This would allow power users to define a breadth first search algorithm #798 , or define their own scattering implementation where they can retrieve coefficients #445 (tho, these futures should be one day in our code base, please see #735).

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
jandencommented, Jun 7, 2022

Are you saying we store a function as an attribute (a sort of callback)? I’m not convinced this is a good idea. The way we currently extend the classes is using inheritance. Adding another way of modifying the core behavior of the classes would just cause confusion, I think.

0reactions
lostanlencommented, May 31, 2022

Hm, i don’t know. Then yes, a field for the algorithm is needed: (just like for out_type)

Maybe refactor scattering this way?

def scattering(self, input, sc_algorithm):
    self.check_input(input)
    phi, psi = self.load_filters()
    x = self.pad(input)
    S = sc_algorithm(x,  self.pad, self.unpad, self.backend ... )
    return self.format(S) 

in this way, we’d be exposing new utility functions (check_input, pad, format …) to potential future core modules (wavelets, phase harmonics …)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use self in Python – explained with examples
This article helps you acquire knowledge on the self variable in Python and its internal working in Python.
Read more >
Self in Python Class | What is the Use of Python Self? - Edureka
It is used in method definitions and in variable initialization. The self method is explicitly used every time we define a method. In...
Read more >
Custom Variable Type - pymoo
Custom Variable Type¶. In the following, we describe a custom variable problem. The variable is a string with a fixed length in our...
Read more >
Constraint-Satisfaction Problems in Python - Manning
To do this, we create a list of variables in self.variables but not in assignment through a list comprehension, and call it unassigned...
Read more >
Classes
Making a random number generator · A class is a container for a set of methods. · Methods work with member variables. ·...
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