Project-MONAI / Project-MONAI/MONAI

AutoencoderKL does not allow to modify the kernel size and stride

Open
#8,447 0 comments 0 reactions 1 assignee View on GitHub

@virginiafdez is already working on this.

Since May 12, 2025.

GenerativeModels
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

In some cases, it is beneficial to use kernel sizes that are different for each dimension (e.g. when the data is anisotropic). Same goes with stride. Currently, AutoencoderKL does not allow the user to input the kernel size; the latter is hard-coded, same as the stride.

Describe the solution you'd like
It would be useful for users to be able to input a kernel size and stride per level, if desired. This could be an int (same for all the network), a list (different for each level) or a list of lists (if the kernel size differs for each dimension). This would have to leave out the last and first layers. Padding would have to be automatically derived to ensure that things run without errors (e.g.: since there are skip-connections, there needs to be an assurance that the input and output to conv. layers are not getting inadvertently downsized or upsized).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.