Metadata-Version: 2.3
Name: torch-activation
Version: 0.3.9
Summary: A library of new activation function implement in PyTorch to save time in experiment and have fun
License: MIT
Author: Alan Huynh
Author-email: hdmquan@outlook.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: kaleido (==0.2)
Requires-Dist: loguru (>=0.7.3,<0.8.0)
Requires-Dist: plotly (>=6.0.0,<7.0.0)
Requires-Dist: pytest (>=8.3.5,<9.0.0)
Requires-Dist: scipy (>=1.15.2,<2.0.0)
Requires-Dist: sphinx (==8.0)
Requires-Dist: torch (>=1.13.0)
Description-Content-Type: text/markdown

# PyTorch Activations

PyTorch Activations is a collection of activation functions for the PyTorch library. This project aims to provide an easy-to-use solution for experimenting with different activation functions or simply adding variety to your models.

## Installation

You can install PyTorch Activations using pip:

```bash
$ pip install torch-activation
```

## Usage

To use the activation functions, import them from torch_activation. Here's an example:

```python
import torch_activation as tac

m = tac.ShiLU(inplace=True)
x = torch.rand(16, 3, 384, 384)
m(x)
```

Or in `nn.Sequential`:

```python
import torch
import torch.nn as nn
import torch_activation as tac

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.net = nn.Sequential(
            nn.Conv2d(64, 32, 2),
            tac.DELU(),
            nn.ConvTranspose2d(32, 64, 2),
            tac.ReLU(inplace=True),
        )

    def forward(self, x):
        return self.net(x)
```

Activation functions can be imported directly from the package, such as `torch_activation.CoLU`, or from submodules, such as `torch_activation.non_linear.CoLU`.

For a comprehensive list of available functions, please refer to the [LIST_OF_FUNCTION](LIST_OF_FUNCTION.md) file.

To learn more about usage, please refer to [Documentation](https://torch-activation.readthedocs.io)

We hope you find PyTorch Activations useful for your experimentation and model development. Enjoy exploring different activation functions!

## Contact

Alan Huynh - [LinkedIn](https://www.linkedin.com/in/hdmquan/) - [hdmquan@outlook.com](mailto:hdmquan@outlook.com)

Project Link: [https://github.com/hdmquan/torch_activation](https://github.com/hdmquan/torch_activation)

Documentation Link: [https://torch-activation.readthedocs.io](https://torch-activation.readthedocs.io)

PyPI Link: [https://pypi.org/project/torch-activation/](https://pypi.org/project/torch-activation/)

