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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for torchact-0.2.2.tar.gz
Algorithm Hash digest
SHA256 81cba68f480da80e2d2d23ec0f2fc15d0e2a8d30c281217a2fa38f024959615e
MD5 f87c2cb4066944326f0bb93a04344205
BLAKE2b-256 7a410680c03d0e0fd42dc8306e53ed325790f142d27e37aa1ecf34893b5a9286

See more details on using hashes here.

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

Hashes for torchact-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e52057abf52fddc063e5480b84a52c7645caade7c457ed695b97d5f9b763790f
MD5 12c083e6f290f73554dadf8cd4517bcd
BLAKE2b-256 932a73e9686aa4aebb8e824575cf54db12d931e8973de37dedaa5ee96e3300fa

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