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

Improve too slow / too many overlapping of networks' unit tests #72

Closed Warvito closed 1 year ago

Warvito commented 1 year ago

Currently the networks are taking significant amount of time in the unit tests. It can be improved by remove redundancy and using smaller networks in the tests.

For example: For the AutoencoderKL https://github.com/Project-MONAI/GenerativeModels/blob/dd08bff0024076186891c1f7518a3210462881ad/tests/test_autoencoderkl.py#L38

and

https://github.com/Project-MONAI/GenerativeModels/blob/dd08bff0024076186891c1f7518a3210462881ad/tests/test_autoencoderkl.py#L23

are building similar networks with same components, having 2 test cases that do not increase coverage.

Other example: For the VQVAE

https://github.com/Project-MONAI/GenerativeModels/blob/dd08bff0024076186891c1f7518a3210462881ad/tests/test_vqvae.py#L25

is testing the network forward using a single image or 3 example in the minibatch. These 2 test cases does not test different methods of the network or different conditions, and this do not test any part added in the VQVAE class.

ericspod commented 1 year ago

Smaller networks and smaller input images would both help. Unless there's a minimum size for a network we should make images smaller, eg. we don't need 256 sized images necessarily.