Giter VIP home page Giter VIP logo

Comments (4)

Edouard360 avatar Edouard360 commented on August 16, 2024

For sure, we can at least factorize __init__, sample_from_posterior_z, sample_from_posterior_l, get_sample_scale, get_sample_rate based on the VAE class. I can take care of that. However the forward methods seems difficult to inherit, so there will be full overriding for VAEC and SVAEC I imagine. I think SVAEC can't inherit anything VAEC: for the __init__ their Classifier has different n_input, n_ouput, and for the forward the only edges in common are already the ones shared with VAE.

from scvi-tools.

jeff-regier avatar jeff-regier commented on August 16, 2024

It does look like some parts of the forward methods for all three classes are shared. e.g.,

https://github.com/YosefLab/scVI/blob/704ce19d80e5728542464e488968c136a241eb6f/scvi/models/vae.py#L87-L94

and

https://github.com/YosefLab/scVI/blob/704ce19d80e5728542464e488968c136a241eb6f/scvi/models/svaec.py#L94-L97

It'd be good to avoid duplicating these part if possible, by storing them only in the base class (i.e. VAE).

from scvi-tools.

Edouard360 avatar Edouard360 commented on August 16, 2024

431d066: started doing it.
Not sure, however, about how to factorize forward method without creating intermediary methods with long arguments list and long signatures.

from scvi-tools.

jeff-regier avatar jeff-regier commented on August 16, 2024

You're right -- we don't want tiny functions with long argument lists. Maybe fine to have some duplicated code in forward methods then.

from scvi-tools.

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.