Tag: Pytorch
All the articles with the tag "Pytorch".
-
3D Convolutional Layers in Rust Candle
Published date:Exploring the lack of 3D operators in the Candle framework and how to simulate 3D convolution using 2D convolutions, particularly for handling video data tasks with time-dimension constraints.
-
PyTorch Equivalent Operations in Rust Candle
Published date:Documenting equivalent operations between PyTorch and Rust Candle, including implementations of scaled dot-product attention (SDPA) and linspace functions with code examples.
-
Is Rust Suitable for AI Model Inference?
Published date:Examining the suitability of Rust for AI model inference, comparing popular frameworks like tch-rs, ONNX Runtime, and Candle, and discussing their advantages and disadvantages in different deployment scenarios.
-
Building a Handwriting Input Method from Scratch: Conclusion
Published date:Wrapping up the series on building a handwriting input method from scratch, discussing the complete implementation, challenges faced, and lessons learned throughout the project.
-
Building a Handwriting Input Method from Scratch: WASM Deployment
Published date:Deploying the trained handwriting recognition model to WebAssembly using Rust, enabling efficient client-side recognition in web browsers.
-
Building a Handwriting Input Method from Scratch: Model Inference
Published date:Implementation of handwriting recognition model inference using Rust Candle, focusing on optimizing performance and efficiency for real-time applications.
-
Building a Handwriting Input Method from Scratch: Model Training
Published date:Detailed guide on processing the CASIA-HWDB dataset and training a handwriting recognition model for Chinese characters using PyTorch, including dataset preprocessing and model implementation.
-
Building a Handwriting Input Method from Scratch: Preparation
Published date:Introduction to building a handwriting input method for Chinese characters from scratch, covering preparation steps, dataset selection, and technical approach using PyTorch for training, Rust Candle for inference, and WASM for deployment.
-
Rust Implementation of RMBG Inference
Published date:This article introduces how to implement RMBG (Remove Image Background) inference using Rust. By loading an ONNX model, it preprocesses the input image (resize, normalization), completes the model inference to generate a mask image, and uses the mask to remove the background or blend transparency. Finally, it optimizes the mask denormalization algorithm to improve background purity, suitable for use in fields like posters, games, etc.
-
Miscellaneous Features in Rust Candle
Published date:This article summarizes some miscellaneous features in the Rust Candle framework, including custom implementations of `masked_fill`, broadcasting mechanism (`broadcast_add`), matrix multiplication (`matmul` vs. element-wise multiplication), and an alternative implementation of the module container `ModuleList`. By comparing with PyTorch, it analyzes the differences and solutions in tensor operations and model loading in Candle.
-
Rust Candle Framework and PyTorch nn Module Network Layer Conversion (1)
Published date:This article compares the similarities and differences between Rust Candle and PyTorch in the implementation of neural network layers, covering sequential containers, convolutional layers (1D/2D and transposed convolution), pooling layers (max pooling and average pooling), and common activation functions. It focuses on analyzing the correspondence between the two in terms of functionality, parameter configuration, and usage, and points out that Candle does not yet support some features such as 3D convolution.
-
Rust Candle Framework and PyTorch nn Module Network Layer Conversion (2)
Published date:This article compares the implementation of common neural network layers in Rust Candle and PyTorch, including normalization layers (BatchNorm, LayerNorm, RMSNorm), recurrent layers (LSTM, GRU), Transformer, linear layers, Dropout layers, embedding layers, and upsampling layers. It summarizes the functional correspondence and differences between the two frameworks and highlights Candle's support for large model inference scenarios.