Package: lietorch
LieTorchThis project provides a python package that expands the functionality of the PyTorch framework with PDE-based group equivariant CNN operators[1].The nameThe name LieTorch is a reference to the Norwegian mathematicianSophus Lie, whose contributions to geometry are extensively used in this project. The name is pronounced/li:/(as inLee) and not/ˈlī/(as inlie).InstallationThe recommended installation method is usingconda.
The following commands will installPyTorchand thelietorchpackage in a new environment.condacreate-n<environmentname>condaactivate<environmentname># install PyTorch the usual waycondainstallpytorchtorchvisiontorchaudiopytorch-cuda=11.8-cpytorch-cnvidia# install LieTorch with condacondainstall-clietorchlietorch# or install with pippipinstalllietorchNeural network modulesModules are grouped according to the manifold they operate on. Most modules have a functional equivalant in thelietorch.nn.functionalnamespace.Euclidean Space ℝ²Basic operators:ModuleFunctionalC++/CUDA backendMorphologicalConvolutionR2morphological_convolution_r2✓FractionalDilationR2fractional_dilation_r2✓FractionalErosionR2fractional_erosion_r2✓ConvectionR2convection_r2⏳DiffusionR2diffusion_r2⏳LinearR2linear_r2✓Position and Orientation Space 𝕄₂Basic operators:ModuleFunctionalC++/CUDA backendLiftM2Cartesianlift_m2_cartesian-ReflectionPadM2reflection_pad_m2-ConvM2Cartesianconv_m2_cartesian-MaxProjectM2max_project_m2-AnisotropicDilatedProjectM2anisotropic_dilated_project_m2✓MorphologicalConvolutionM2morphological_convolution_m2✓LinearConvolutionM2linear_convolution_m2✓ConvectionM2convection_m2✓DiffusionM2diffusion_m2⏳FractionalDilationM2fractional_dilation_m2✓FractionalErosionM2fractional_erosion_m2✓LinearM2linear_m2✓High-level modules for implementing PDE-based networks:ModuleDescription/PDEConvectionDilationPdeM2$u_t=-\mathbf{c}u + \lVert \nabla u \rVert^{2 \alpha}_{\mathcal{G}}$ConvectionErosionPdeM2$u_t=-\mathbf{c}u - \lVert \nabla u \rVert^{2 \alpha}_{\mathcal{G}}$CDEPdeLayerM2$u_t=-\mathbf{c}u + \lVert \nabla u \rVert^{2 \alpha}_{\mathcal{G}_1} - \lVert \nabla u \rVert^{2 \alpha}_{\mathcal{G}_2}$with batch normalization and linear combinationsLoss functionsAdditional loss functions.ModuleFunctionalDescriptionlietorch.nn.loss.DiceLosslietorch.nn.functional.dice_lossBinary DICE lossGenericThe modules in the generic category do not fit into any previous category and include operators that serve as C++/CUDA implementation examples.ModuleFunctionalC++/CUDA backendGrayscaleDilation2Dgrayscale_dilation_2d✓GrayscaleErosion2Dgrayscale_erosion_2d✓DependenciesThe current version of thelietorchpython package has the following dependencies.python 3.9+pytorch 1.12+torchvision 0.13+The included experiments additionally depend on the following packages.scikit-learntqdmnumpystymlflowlibtiffStructure/lietorchcontains the main python package./experimentscontains various experiments, including those used in publications./testscontains unit tests./backendcontains the source code of the C++/CUDA backend,see./backend/README.mdif you wish to compile the extension yourself./assetsvarious files used in tests and documentation.CiteIf you use this code in your own work please cite our paper:[1] Smets, B.M.N., Portegies, J., Bekkers, E.J. et al. PDE-Based Group Equivariant Convolutional Neural Networks. J Math Imaging Vis (2022).https://doi.org/10.1007/s10851-022-01114-x@article{smets2022pde,
  title={PDE-based Group Equivariant Convolutional Neural Networks},
  author={Smets, Bart and Portegies, Jim and Bekkers, Erik and Duits, Remco},
  journal={Journal of Mathematical Imaging and Vision},
  year={2022},
  doi={10.1007/s10851-022-01114-x},
  url={https://doi.org/10.1007/s10851-022-01114-x}
}