Project-MONAI / GenerativeModels

MONAI Generative Models makes it easy to train, evaluate, and deploy generative models and related applications
Apache License 2.0
604 stars 87 forks source link

Should we create common interface to support a second stage model? #22

Closed Warvito closed 1 year ago

Warvito commented 1 year ago

@ericspod Should we create a common interface between VQ-VAE and AEKL to make them easy to interchange with each other when we are getting the latent representations (example proposed here https://github.com/Project-MONAI/GenerativeModels/pull/13#issuecomment-1287775965)?

It would make these two models different from the MONAI models (such as https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/nets/varautoencoder.py and https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/nets/autoencoder.py) and future generative models.

ericspod commented 1 year ago

Late getting to this one but yes we should be trying to have common interfaces where arguments and return values have the same meaning. This means using the same variable names in places to mean the same thing, eg. x for the main input to forward, but also choosing generic names that can encompass other usages of the same argument in different models. In general the best we can do to have a uniform interface and be able to substitute one model for another when it makes sense is good. We should try to keep to MONAI patterns as possible but it's not always feasible of course.

danieltudosiu commented 1 year ago

@Warvito should we try and sit down and define the interface?