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.2.2.tar.gz
(6.6 kB
view details)
Built Distribution
File details
Details for the file torchact-0.2.2.tar.gz
.
File metadata
- Download URL: torchact-0.2.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81cba68f480da80e2d2d23ec0f2fc15d0e2a8d30c281217a2fa38f024959615e |
|
MD5 | f87c2cb4066944326f0bb93a04344205 |
|
BLAKE2b-256 | 7a410680c03d0e0fd42dc8306e53ed325790f142d27e37aa1ecf34893b5a9286 |
File details
Details for the file torchact-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: torchact-0.2.2-py3-none-any.whl
- Upload date:
- Size: 9.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 | e52057abf52fddc063e5480b84a52c7645caade7c457ed695b97d5f9b763790f |
|
MD5 | 12c083e6f290f73554dadf8cd4517bcd |
|
BLAKE2b-256 | 932a73e9686aa4aebb8e824575cf54db12d931e8973de37dedaa5ee96e3300fa |