|
1 | | -# Xircuits Comprehensive PyTorch Libraries |
| 1 | + |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <a href="https://github.com/XpressAI/xircuits/tree/master/xai_components#xircuits-component-library-list">Component Libraries</a> • |
| 5 | + <a href="https://github.com/XpressAI/xircuits/tree/master/project-templates#xircuits-project-templates-list">Project Templates</a> |
| 6 | + <br> |
| 7 | + <a href="https://xircuits.io/">Docs</a> • |
| 8 | + <a href="https://xircuits.io/docs/Installation">Install</a> • |
| 9 | + <a href="https://xircuits.io/docs/category/tutorials">Tutorials</a> • |
| 10 | + <a href="https://xircuits.io/docs/category/developer-guide">Developer Guides</a> • |
| 11 | + <a href="https://github.com/XpressAI/xircuits/blob/master/CONTRIBUTING.md">Contribute</a> • |
| 12 | + <a href="https://www.xpress.ai/blog/">Blog</a> • |
| 13 | + <a href="https://discord.com/invite/vgEg2ZtxCw">Discord</a> |
| 14 | +</p> |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +<p align="center"><i>Xircuits Component Library for integrating PyTorch! Build and deploy machine learning models with ease.</i></p> |
| 22 | + |
| 23 | +## Xircuits Comprehensive PyTorch Libraries |
2 | 24 |
|
3 | 25 | These libraries collectively provide extensive functionalities for integrating PyTorch into Xircuits workflows, encompassing both general PyTorch operations and neural network-specific tasks. |
4 | 26 |
|
5 | | -### Installation |
| 27 | +## Table of Contents |
| 28 | + |
| 29 | +- [Prerequisites](#prerequisites) |
| 30 | +- [Installation](#installation) |
| 31 | +- [Getting Started with PyTorch XAI Components](#getting-started-with-pytorch-xai-components) |
| 32 | +- [Try The Examples](#try-the-examples) |
| 33 | +- [Components Overview](#components-overview) |
| 34 | +- [Contributing](#contributing) |
| 35 | + |
| 36 | +## Prerequisites |
| 37 | + |
| 38 | +Before using this library, you’ll need the following: |
| 39 | + |
| 40 | +1. **Python 3.8** or higher |
| 41 | +2. **Xircuits** |
| 42 | +3. The following Python packages: |
| 43 | + - **torch** |
| 44 | + - **torchvision** |
| 45 | + - **pillow** |
| 46 | + |
| 47 | + |
| 48 | +## Installation |
| 49 | + |
| 50 | +To use this component library, ensure that you have an existing [Xircuits setup](https://xircuits.io/docs/main/Installation). You can then install the PyTorch library using the [component library interface](https://xircuits.io/docs/component-library/installation#installation-using-the-xircuits-library-interface), or through the CLI using: |
| 51 | + |
6 | 52 |
|
7 | | -To use this component library in Xircuits, simply run the Xircuits install command in your working directory. |
8 | 53 | ```bash |
9 | 54 | xircuits install pytorch |
10 | 55 | ``` |
11 | 56 |
|
12 | | -Alternatively, you may also clone this repository into your `xai_components` directory and install it manually via |
| 57 | +Alternatively, you may clone this repository into your `xai_components` directory and install it manually: |
| 58 | + |
| 59 | +```bash |
| 60 | +# To clone the PyTorch component library into your Xircuits project directory |
| 61 | +git clone https://github.com/XpressAI/xai-pytorch.git xai_components/xai_pytorch |
13 | 62 | ``` |
14 | | -pip install -r requirements.txt |
| 63 | +```bash |
| 64 | +# Install required dependencies |
| 65 | +pip install -r xai_components/xai_pytorch/requirements.txt |
15 | 66 | ``` |
16 | 67 |
|
17 | | -## Xircuits PyTorch Component Library |
18 | | -Core components essential for developing and deploying machine learning models using PyTorch in Xircuits, covering tasks from data preparation to model evaluation. |
19 | | - |
20 | | -### Components |
21 | | -- **LoadTorchVisionDataset**: Loads Torch Vision datasets like MNIST and CIFAR. |
22 | | -- **TorchDataLoader**: Creates DataLoader instances for efficient batch processing. |
23 | | -- **ExampleTorchModelConfig**: Sets up an example Torch model with configurable parameters. |
24 | | -- **TrainTorchModel**: Trains a Torch model with a given DataLoader and configuration. |
25 | | -- **TestTorchModel**: Tests a trained Torch model for performance evaluation. |
26 | | -- **SaveTorchModelState**: Saves the state of a trained Torch model. |
27 | | -- **LoadTorchModelState**: Loads a saved Torch model's state. |
28 | | -- **TorchModelPredict**: Performs predictions using a trained Torch model. |
29 | | -- **Image2TorchTensor**: Converts images to Torch tensors for model input. |
30 | | -- **TorchModelPredictFromTensor**: Predicts using a Torch model and tensor input. |
31 | | - |
32 | | -## Xircuits PyTorch Neural Network Component Library |
33 | | - |
34 | | -Designed for building and configuring neural network models in Xircuits. It offers flexibility in customizing architectures for various machine learning and deep learning tasks. |
35 | | - |
36 | | -### Components |
37 | | -- **TorchModel**: Builds custom Torch neural network models. |
38 | | -- **TorchAddLinearLayer**: Adds linear layers to a model. |
39 | | -- **TorchAddConv1DLayer** and **TorchAddConv2DLayer**: Integrates 1D and 2D convolutional layers. |
40 | | -- **TorchAddTransformerEncoderLayer** and **TorchAddTransformerDecoderLayer**: Adds Transformer Encoder and Decoder layers. |
41 | | -- **TorchLSTM**: Incorporates LSTM layers for sequence data. |
42 | | -- **TorchAddReluLayer**: Adds ReLU activation layers. |
43 | | -- **TorchAddDropoutLayer**: Includes dropout layers for regularization. |
| 68 | +## Getting Started With PyTorch XAI Components |
| 69 | + |
| 70 | +After successfully installing the necessary libraries and components, you are ready to explore the PyTorch XAI Components Library. This library enables you to develop comprehensive machine learning workflows within Xircuits. Refer to the provided documentation and examples to master the integration, customization, and utilization of deep learning components using PyTorch XAI. |
| 71 | + |
| 72 | +## Try The Examples |
| 73 | + |
| 74 | +We have provided an example workflow to help you get started with the PyTorch XAI Components Library. Give it a try and see how you can create a custom deep learning workflow for your projects. |
| 75 | + |
| 76 | +### PytorchTrainModel |
| 77 | + |
| 78 | +This example demonstrates the initial setup of a machine learning workflow in Xircuits using the PyTorch XAI Components Library. It involves training a custom neural network model on your dataset. This step is crucial as the output model will be used in subsequent examples. |
| 79 | + |
| 80 | +### PytorchPredictFromModel |
| 81 | + |
| 82 | +Following the training process, this example shows how to use the trained model to make predictions. It leverages the model trained by the `PytorchTrainModel` to demonstrate the prediction process on new data, showcasing how to integrate trained models into practical applications. |
| 83 | + |
| 84 | +### PytorchTrainCustomNN |
| 85 | + |
| 86 | +This example extends the capabilities of the PyTorch XAI Components by illustrating how to train a more complex, custom neural network. It utilizes advanced features of PyTorch to tailor a neural network to specific needs beyond standard models. |
| 87 | + |
| 88 | +**Note:** It is important to run the `PytorchTrainModel` example first, as the other examples depend on the output from this initial training step. |
| 89 | + |
| 90 | + |
| 91 | +## Components Overview |
| 92 | + |
| 93 | +The PyTorch XAI Components Library offers an array of components tailored for various stages of the deep learning lifecycle. Explore these components and refer to their documentation to enhance your ability to develop sophisticated deep learning workflows. |
| 94 | + |
| 95 | +## Contributing |
| 96 | + |
| 97 | +We welcome contributions to the **Pytorch XAI Components Library**! If you would like to contribute: |
| 98 | + |
| 99 | +1. Fork the repository. |
| 100 | +2. Create a new branch for your feature or bug fix. |
| 101 | +3. Open a pull request with a detailed description of your changes. |
| 102 | + |
| 103 | +Please feel free to suggest new components, improvements, or optimizations. If you encounter any issues or have ideas for enhancements, you can open an issue in the repository. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +### License |
| 108 | + |
| 109 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. |
0 commit comments