TorchAct, collection of activation function for PyTorch.
Project description
torchact
Quick Start
import torch
import torch.nn as nn
from torchact import ReLU
model = nn.Sequential(
nn.Linear(5, 3),
ReLU(),
nn.Linear(3, 1)
)
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.)
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-0.1.1.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file torchact-0.1.1.tar.gz
.
File metadata
- Download URL: torchact-0.1.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a809d103825223fc629a87533380f7ff383e71ec24a52e16534f5d7960654cb5 |
|
MD5 | ee40b70e2048cc6e084590dd7fdbdb4f |
|
BLAKE2b-256 | 2670b49548b8864443c142b2e0a5f65a510896aba93adbf77b832bea247aa131 |
File details
Details for the file torchact-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: torchact-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3664fb5485baf04bf48cf9813444e92b309c5c3af37bdde253e286bfef1f21f |
|
MD5 | 3ea572d4dbec4a19019a7a91a9b065ad |
|
BLAKE2b-256 | db770a46c95a25a12da5f56df286218065b112f2521c67fbfdc2779fedc65381 |