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.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

torchact-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for torchact-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a809d103825223fc629a87533380f7ff383e71ec24a52e16534f5d7960654cb5
MD5 ee40b70e2048cc6e084590dd7fdbdb4f
BLAKE2b-256 2670b49548b8864443c142b2e0a5f65a510896aba93adbf77b832bea247aa131

See more details on using hashes here.

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

Hashes for torchact-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3664fb5485baf04bf48cf9813444e92b309c5c3af37bdde253e286bfef1f21f
MD5 3ea572d4dbec4a19019a7a91a9b065ad
BLAKE2b-256 db770a46c95a25a12da5f56df286218065b112f2521c67fbfdc2779fedc65381

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