greenelab / tybalt

Training and evaluating a variational autoencoder for pan-cancer gene expression data
BSD 3-Clause "New" or "Revised" License
162 stars 61 forks source link

Adding Conditional Tybalt Model #105

Closed gwaybio closed 6 years ago

gwaybio commented 6 years ago

Major change is adding new class cTybalt - which implements a cVAE. The implementation is modified from a blog post.

Other changes include an increased abstraction step (class VAE) which now inherits from BaseModel. Both Tybalt and cTybalt now inherit from VAE. These base models are moved to a new file (tybalt/utils/base.py), which is imported by tybalt/models.py.

gwaybio commented 6 years ago

Thanks for comments @danich1 - I believe I addressed them in the most recent commits. Thanks!

jaclyn-taroni commented 6 years ago

This might be my lack of Python/Keras knowledge talking, but it looks to me like the only difference between Tybalt and cTybalt is a few lines adding the conditional vector -- is there a reason one would need to write "new" encoder/decoder functions @gwaygenomics? Thinking about this from a code repetition point of view

gwaybio commented 6 years ago

but it looks to me like the only difference between Tybalt and cTybalt is a few lines adding the conditional vector -- is there a reason one would need to write "new" encoder/decoder functions?

Yeah, I was weighing pros/cons here too. The differences are fairly small between the two models - the inputs and input/output dimensions are different and some of the layer connections are slightly different as well. While I could abstract some of this away and thus reduce the number of lines, I think it would come at a cost of interpretability. Having each autoencoder model build their own graph makes things easier to read I think. And it doesn't change usage too