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.0.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file torchact-0.2.0.tar.gz
.
File metadata
- Download URL: torchact-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c494c56b6db449a8eb5a459a3fc3636458e04f4d1f1f79f961343efbf1b8f165 |
|
MD5 | dfa8dff27ce5835f3319aa19978ef59b |
|
BLAKE2b-256 | c7df822a0900d7f7523d4dd191190ec9eb8c8562ded86f51ab5fc4df6bd557de |
File details
Details for the file torchact-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: torchact-0.2.0-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 | b2ee045648547e804f222bd2e64448b6f7f546c36f79af72088fc3716533f84d |
|
MD5 | 468faad1072a6b448154d24698fc6cd5 |
|
BLAKE2b-256 | 6b24b96b48674c4798eabcf5c729e0fdf2148a56edff9380b6480e633d7159b1 |