Git Product home page Git Product logo

Comments (6)

bmcfee avatar bmcfee commented on August 30, 2024

Can you describe situations in which you wouldn't want a name for each feature extractor?

The point here is to provide a way of (hierarchically) grouping features together where there could otherwise be namespace conflicts. For instance, if you for some reason wanted to have a CQT and STFT together, they could both have mag and phase features, so the only thing keeping them separate is the name scope.

from pumpp.

beasteers avatar beasteers commented on August 30, 2024

right, but couldn't we infer the name from the feature extractor?

Like by default, we could name them cqt/mag and stft/mag. I feel like we shouldn't need to explicitly name them for simple cases like tthat. If you wanted two STFT then you could name them explicitly name='stft_1' and name='stft_2'

Or what would be fun would be the automatically incrementing the names like tensorflow does, but that's probably a bit extra.

from pumpp.

bmcfee avatar bmcfee commented on August 30, 2024

Oh i see -- are you then suggesting that we have default names for the feature extractors? I could be okay with that.

from pumpp.

beasteers avatar beasteers commented on August 30, 2024

Yep! Something like this:

from pumpp.feature import STFT, Mel, STFTPhaseDiff
import inflection

for cls in [STFT, Mel, STFTPhaseDiff]:
    print(inflection.underscore(cls.__name__), cls)
stft <class 'pumpp.feature.fft.STFT'>
mel <class 'pumpp.feature.mel.Mel'>
stft_phase_diff <class 'pumpp.feature.fft.STFTPhaseDiff'>

from pumpp.

bmcfee avatar bmcfee commented on August 30, 2024

Well, I don't think we need to get fancy with this: explicit strings are better IMO. And we're only talking about a handful of classes anyway, so may as well hard-wire it in for the sake of readability.

The only hiccup is around default args and positionals: we can do this if we make all arguments keyword-only, which I generally like stylistically.

from pumpp.

beasteers avatar beasteers commented on August 30, 2024

Sure, that's fine by me. I was more just demonstrating the pattern.

And yeah I agree about kw-only. I think in cases like this it totally makes sense (what should the first argument to Mel be anyways?).

from pumpp.

Related Issues (20)

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.