Skip to main content

torchact

TorchAct, collection of activation function for PyTorch.


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

Quick Start

import torch
import torch.nn as nn
import torchact.nn as actnn

model = nn.Sequential(
    nn.Linear(5, 3),
    actnn.ReLU(),
    nn.Linear(3, 1),
    nn.Sigmoid()
)

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.)

Citing TorchAct

To cite this repository:

@article{hantorchact,
  title={TorchAct, collection of activation function for PyTorch.},
  author={Seungwoo Han},
  publisher={Engineering Archive},
  doi={10.31224/2988},
  url={https://engrxiv.org/preprint/view/2988}
  year={2023}
}

Metadata

Release files for torchact 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchact 1.1.2
File Size Uploaded
torchact-1.1.2.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torchact 1.1.2
File Interpreter ABI Platform
torchact-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / torchact-1.1.2.tar.gz

Download URL torchact-1.1.2.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e088fcb09d7a0fe8d2999a3dc0d3ffd1e23eb39bb6fdcd430f969e1d970c421b
BLAKE2b-256 checksum
How to use checksums
9e440d1d4899015b5416e47a0affd659092611adbd1f3a7e496d77e8d9109356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / torchact-1.1.2-py3-none-any.whl

Download URL torchact-1.1.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec14804f0b393474d62160ccdf0d05484340c530c95a48f24785e0263b95fc76
BLAKE2b-256 checksum
How to use checksums
3b452af1f1227242b649a20036146a114ab2242b361868812f74add884aba16f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page