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

Uploaded Source

Built Distribution

torchact-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file torchact-0.1.0.tar.gz.

File metadata

  • Download URL: torchact-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 09912e05273128ad5e73fc8377d13274330c9165f926d7ab485e85efda2e195e
MD5 e060bd77ade1aeff7b49fbdd3d306610
BLAKE2b-256 52934187211ee4b74872534af02a5997db4f5e892f13b53201c27f5dacf9ca6e

See more details on using hashes here.

File details

Details for the file torchact-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: torchact-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5157eec3c685cfcb0dc93d1fd236b0d8f790982237fe6d4727aa1157f6ac12d9
MD5 8c474b133ca55f242f6962fa0eff894e
BLAKE2b-256 30d98e35e5940eb4c3953c7d51a55e0e7ff64b7c75a5038cbda7175969203476

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