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.

Tidy up the model subpackages

See original GitHub issue

🚀 Refactoring

The structure in pl_bolts.models is not user-friendly due to:

  • an inconsistent structure, for example:

    from pl_bolts.models.vision import SemSegment  # This works fine.
    from pl_bolts.models.vision import ImageGPT    # This doesn't work,
    from pl_bolts.models import ImageGPT           # but this works.
    
  • several ways to import a certain class, for example: <- (related: #423)

    from pl_bolts.models import LogisticRegression
    from pl_bolts.models.regression import LogisticRegression
    from pl_bolts.models.regression.logistic_regression import LogisticRegression
    

Pitch

Two options I have in mind to make it consistent are:

  1. Make all models available right under pl_bolts.models

    pl_bolts.models.VAE
    pl_bolts.models.AE
    pl_bolts.models.ImageGPT
    pl_bolts.models.PixelCNN
    pl_bolts.models.SwAV
    pl_bolts.models.SimCLR
    ...
    
  2. Split models into domains, e.g. vision, self_supervised… (which I prefer)

    pl_bolts.models.autoencoders.VAE
    pl_bolts.models.autoencoders.AE
    pl_bolts.models.vision.ImageGPT
    pl_bolts.models.vision.PixelCNN
    pl_bolts.models.self_supervised.SwAV
    pl_bolts.models.self_supervised.SimCLR
    ...
    

@Borda @ananyahjha93 @annikabrundyn @oke-aditya I’d love to hear your opinions on if it should be as is or another interface :]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
oke-adityacommented, Feb 16, 2021

Haha so true, it is not regression a task. But maybe put it under pl_bolts.models.ml ? Where we could have simple ml models.

2reactions
Bordacommented, Jan 18, 2021

I am for some refactoring in this direction, just I would recommend stabilizing the state e have right now as 0.3 and do this refactor in 0.4 which can be even next week :]

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I let Django load models from subpackages of apps?
Is there any way to let Django dynamically read all the model classes in all models.py files in all subpackages of app ?...
Read more >
10.4. Creating Subpackages - Jeff's Home Page
In most cases, subpackages are created just as a means to partition the files produced by a package into separate packages. For example,...
Read more >
Proper way of organizing code into subpackages - New to Julia
C. Build sub packages into actual packages. Do generate foo_dir/foo under Pkg mode and use dev foo_dir/foo in bar's environment.
Read more >
SDist builds incorrectly auto detects subpackages of excluded ...
I just tested this on Poetry version 1.0.0b4 and I'm still seeing the same issue. ... fix: exclude subpackage from setup.py if __init__.py...
Read more >
3.3. Providing syspaths Subpackages - Red Hat Customer Portal
The wrapper installed in /usr/bin/ sets up the correct environment and executes the target binary located withing the /opt/provider/%{scl} file system hierarchy ...
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