TorchAct, collection of activation function for PyTorch.
Project description
torchact
Quick Start
import torch
import torch.nn as nn
import torchact.nn as actnn
model = nn.Sequential(
nn.Linear(5, 3),
actnn.ReLU(),
nn.Linear(3, 1),
nn.Sigmoid()
)
dummy = torch.rand(1, 5)
print(model(dummy))
Installation
pip install torchact
How to Contribute
Thanks for your contribution!
There are several steps for contributing.
- Fork this repo (you can work dev branch.)
- Install library using
requirements.txt
- Write your code in torchact folder.
- Add your module in
__init__.py
(__version__
cannot be changed. It will be decided later.)
For example.
from .your_module import Your_Module
__all__ = ("ReLU", "SinLU", "Softmax", "Your_Module")
- If you want to test case, Write test case.
For example.
def test_has_attr():
for activation_name in __all__:
if activation_name == "Softmax":
assert hasattr(str_to_class(activation_name)(), "dim")
else:
pass
- Run black style.
black .
- Send a PR. Code testing happens automatically. (PYPI is upgraded by the admin himself.)
Citing TorchAct
To cite this repository:
@article{hantorchact,
title={TorchAct, collection of activation function for PyTorch.},
author={Seungwoo Han},
publisher={Engineering Archive},
doi={10.31224/2988},
url={https://engrxiv.org/preprint/view/2988}
year={2023}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchact-1.1.2.tar.gz
(8.5 kB
view details)
Built Distribution
torchact-1.1.2-py3-none-any.whl
(10.1 kB
view details)
File details
Details for the file torchact-1.1.2.tar.gz
.
File metadata
- Download URL: torchact-1.1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e088fcb09d7a0fe8d2999a3dc0d3ffd1e23eb39bb6fdcd430f969e1d970c421b |
|
MD5 | fb22dd1bbd0eca2bea40d1135c65df4f |
|
BLAKE2b-256 | 9e440d1d4899015b5416e47a0affd659092611adbd1f3a7e496d77e8d9109356 |
File details
Details for the file torchact-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: torchact-1.1.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec14804f0b393474d62160ccdf0d05484340c530c95a48f24785e0263b95fc76 |
|
MD5 | 183a7a00302d48db54591494f0db3d98 |
|
BLAKE2b-256 | 3b452af1f1227242b649a20036146a114ab2242b361868812f74add884aba16f |