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}
}
Metadata
Release files for torchact 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torchact-1.1.2.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torchact-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.6 kB
Release files / torchact-1.1.2.tar.gz
| Download URL | torchact-1.1.2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e088fcb09d7a0fe8d2999a3dc0d3ffd1e23eb39bb6fdcd430f969e1d970c421b
|
|
BLAKE2b-256 checksum How to use checksums |
9e440d1d4899015b5416e47a0affd659092611adbd1f3a7e496d77e8d9109356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / torchact-1.1.2-py3-none-any.whl
| Download URL | torchact-1.1.2-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec14804f0b393474d62160ccdf0d05484340c530c95a48f24785e0263b95fc76
|
|
BLAKE2b-256 checksum How to use checksums |
3b452af1f1227242b649a20036146a114ab2242b361868812f74add884aba16f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|