### Train WTConvNeXt-S (Multi-GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Distributed training script for WTConvNeXt-S using `torchrun`. This example configures training across 4 GPUs. ```sh torchrun --nproc-per-node=4 \ python train.py --model wtconvnext_small --drop-path 0.1 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 16 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Train WTConvNeXt-B (Multi-GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Distributed training configuration for WTConvNeXt-B using `torchrun`. This example is set up for 4 GPUs. ```sh torchrun --nproc-per-node=4 \ python train.py --model wtconvnext_base --drop-path 0.5 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 16 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Install MMClassification Source: https://github.com/bgu-cs-vil/wtconv/blob/main/semantic_segmentation/README.md Install MMClassification, a dependency for certain MMSegmentation functionalities. Ensure you are using version 1.0.0 or higher. ```shell pip install mmpretrain>=1.0.0 ``` -------------------------------- ### Train WTConvNeXt-T (Multi-GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Use this script with `torchrun` for distributed training of WTConvNeXt-T. The effective batch size should be 4096. This example uses 4 GPUs. ```sh torchrun --nproc-per-node=4 \ python train.py --model wtconvnext_tiny --drop-path 0.1 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 16 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Import and Initialize WTConv2d Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Demonstrates how to import and initialize the WTConv2d layer for use in custom CNN architectures. Specify input and output channels, kernel size, and wavelet levels. ```python from wtconv import WTConv2d conv_dw = WTConv2d(32, 32, kernel_size=5, wt_levels=3) ``` -------------------------------- ### Train WTConvNeXt-S (Single GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Script for training the WTConvNeXt-S model on a single GPU. Adjust `IMAGENET_PATH` and other parameters as needed. ```sh python train.py --model wtconvnext_small --drop-path 0.4 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 64 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Use WTConvNeXt with timm Model Registry Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Shows how to load a WTConvNeXt model using the timm library's model registry. This is useful for leveraging pre-trained WTConvNeXt architectures for various tasks. ```python import wtconvnext model = create_model( "wtconvnext_tiny", pretrained=False, num_classes=1000 ) ``` -------------------------------- ### Train WTConvNeXt-B (Single GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Command to train the WTConvNeXt-B model on a single GPU. Ensure the `IMAGENET_PATH` is correctly specified. ```sh python train.py --model wtconvnext_base --drop-path 0.4 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 64 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Fast WTConv Implementation Citation Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md BibTeX entry for citing the fast implementation of WTConv, including CUDA/MPS/Triton optimizations. ```bibtex @misc{aflalo2026fastwtconv, author = {Aflalo, Amit and Amoyal, Roy and Finder, Shahaf E and Treister, Eran and Freifeld, Oren}, title = {Fast Implementation for WTConv}, year = {2026}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/BGU-CS-VIL/WTConv}}, note = {Commit hash: bb50df4} } ``` -------------------------------- ### Train WTConvNeXt-T (Single GPU) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Use this script to train the WTConvNeXt-T model on ImageNet-1k. Ensure IMAGENET_PATH is set correctly. This configuration is for single-GPU training. ```sh python train.py --model wtconvnext_tiny --drop-path 0.1 \ --data-dir IMAGENET_PATH \ --epochs 300 --warmup-epochs 20 \ --batch-size 64 --grad-accum-steps 64 --sched-on-updates \ --lr 4e-3 --weight-decay 5e-2 \ --opt adamw --layer-decay 1.0 \ --aa rand-m9-mstd0.5-inc1 \ --reprob 0.25 --mixup 0.8 --cutmix 1.0 \ --model-ema --model-ema-decay 0.9999 \ --output checkpoints/wtconvnext_tiny_300/ ``` -------------------------------- ### Standard WTConv2d Usage (Auto-Detect) Source: https://github.com/bgu-cs-vil/wtconv/blob/main/fast_wtconv/README.md Initialize and use the WTConv2d layer. The layer automatically detects and uses the appropriate optimized kernel for CUDA or MPS devices. Ensure the layer and input tensor are moved to the target device. ```python import torch from fast_wtconv.wtconv import WTConv2d # Initialize layer # in_channels, out_channels, kernel_size, stride, wt_levels layer = WTConv2d(64, 64, kernel_size=5, wt_levels=2) # Move to device (CUDA or MPS) device = 'cuda' if torch.cuda.is_available() else 'mps' layer = layer.to(device) # Forward pass x = torch.randn(1, 64, 224, 224).to(device) output = layer(x) ``` -------------------------------- ### Triton Backend WTConv2d Usage Source: https://github.com/bgu-cs-vil/wtconv/blob/main/fast_wtconv/README.md Initialize and use the WTConv2d layer with the pure Triton implementation. This is useful for environments without CUDA or for specific performance tuning. Ensure the layer and input tensor are on the CUDA device. ```python import torch from fast_wtconv.wtconv_triton import WTConv2d as WTConv2dTriton # Initialize Triton layer layer = WTConv2dTriton(64, 64, kernel_size=5, wt_levels=2).cuda() # Forward pass x = torch.randn(1, 64, 224, 224).cuda() output = layer(x) ``` -------------------------------- ### Evaluate WTConvNeXt on ImageNet-1k Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md Script to validate the performance of a trained WTConvNeXt model on the ImageNet-1k dataset. Specify the model name, data directory, and checkpoint file. ```sh python validate.py --model wtconvnext_tiny \ --data-dir IMAGENET_PATH \ --checkpoint WTConvNeXt_tiny_5_300e_ema.pth ``` -------------------------------- ### WTConvNeXt BibTeX Citation Source: https://github.com/bgu-cs-vil/wtconv/blob/main/README.md BibTeX entry for citing the WTConvNeXt paper at the European Conference on Computer Vision. ```bibtex @inproceedings{finder2024wavelet, title = {Wavelet Convolutions for Large Receptive Fields}, author = {Finder, Shahaf E and Amoyal, Roy and Treister, Eran and Freifeld, Oren}, booktitle = {European Conference on Computer Vision}, year = {2024}, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.