Skip to content

Migrate from TensorFlow to PyTorch #16

Description

@nikolaitennant

Consider migrating the CNN model from TensorFlow/Keras to PyTorch for:

  • Better integration with scvi-tools (already PyTorch-based)
  • Eliminates the TensorFlow/PyTorch dependency conflict for batch correction
  • More active ecosystem for research ML
  • Simpler dependency management (single framework)

The core model is a simple 1D CNN — the migration would be straightforward.

Plan

  1. Clean up TF version on main (current work)
  2. Create pytorch branch from clean main
  3. Swap TF model code to PyTorch (~15 lines of model definition)
  4. Remove TensorFlow from dependencies, add PyTorch
  5. Remove the [batch-correction] optional extra (PyTorch already installed)
  6. Tag as v2.0.0 when ready

Note: The published paper (Tennant et al., 2026) states TensorFlow was used. The main branch at v1.0.0 preserves this. The PyTorch migration is a post-publication improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions