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.0.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file torchact-0.1.0.tar.gz
.
File metadata
- Download URL: torchact-0.1.0.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 | 09912e05273128ad5e73fc8377d13274330c9165f926d7ab485e85efda2e195e |
|
MD5 | e060bd77ade1aeff7b49fbdd3d306610 |
|
BLAKE2b-256 | 52934187211ee4b74872534af02a5997db4f5e892f13b53201c27f5dacf9ca6e |
File details
Details for the file torchact-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: torchact-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 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 | 5157eec3c685cfcb0dc93d1fd236b0d8f790982237fe6d4727aa1157f6ac12d9 |
|
MD5 | 8c474b133ca55f242f6962fa0eff894e |
|
BLAKE2b-256 | 30d98e35e5940eb4c3953c7d51a55e0e7ff64b7c75a5038cbda7175969203476 |