Skip to main content

TorchAct, collection of activation function for PyTorch.

Project description

torchact

TorchAct, collection of activation function for PyTorch.


image CI codecov Read the Docs
image PyPI - Status PyPI - Python Version image Downloads
image PyPI - License image

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.

  1. Fork this repo (you can work dev branch.)
  2. Install library using requirements.txt
  3. Write your code in torchact folder.
  4. 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")
  1. 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
  1. Run black style.black .
  2. Send a PR. Code testing happens automatically. (PYPI is upgraded by the admin himself.)

Project details


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)

Uploaded Source

Built Distribution

torchact-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

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

Hashes for torchact-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c494c56b6db449a8eb5a459a3fc3636458e04f4d1f1f79f961343efbf1b8f165
MD5 dfa8dff27ce5835f3319aa19978ef59b
BLAKE2b-256 c7df822a0900d7f7523d4dd191190ec9eb8c8562ded86f51ab5fc4df6bd557de

See more details on using hashes here.

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

Hashes for torchact-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2ee045648547e804f222bd2e64448b6f7f546c36f79af72088fc3716533f84d
MD5 468faad1072a6b448154d24698fc6cd5
BLAKE2b-256 6b24b96b48674c4798eabcf5c729e0fdf2148a56edff9380b6480e633d7159b1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page