FWU is a series of PyTorch-based neural network units. It has higher information utilization, prevents neuronal necrosis, and eliminates the need to add additionall activation functions.
Project description
FWU
FWU is a series of PyTorch-based neural network units.It has higher information utilization, prevents neuronal necrosis, and eliminates the need to add additionall activation functions.
思路说明
ReLU滤除了小于零的输入,虽然高效实现了非线性,但对小于零的输入无梯度回传,导致了神经元坏死.目前有多种模仿ReLU的平滑版激活函数,通过在输入刚小于零时提供显著的反向梯度、在梯度更小时也提供微小的梯度,部分缓解了ReLU中神经元坏死的问题. FWU系列直接输入的符号将输入分为>0和<0两部分,分别送入两个单元(Linear或Conv或其他),再对两个单元的输出做二元运算(加法或乘法或其他).即提供了非线性,又最大程度上利用信息完全杜绝了神经元坏死.
目前提供了加法(FWLU)和乘法(FWMU)的Linear、Conv1d、Conv2d、和对应转置卷积的实现.无后缀代表Linear,1D、2D后缀代表对应维度的卷积,加T后缀代表转置卷积.
部分参数,如kernel_size、padding可以通过加_N后缀实现对负分支的专门控制.用以对正负分支添加不同的前后偏移或使用不同宽高比的卷积核,可以减少参数量增大感受野.
Install
pip install FWU
Use
from FWU import FWLU2DT
...
import后直接替代对应的Linear、Conv1d、Conv2d等,并取消与其组合的激活函数(输出层的SoftMax等承担特殊功能的激活函数除外).
HomePage
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fwu-0.0.3.tar.gz.
File metadata
- Download URL: fwu-0.0.3.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e9a37c41ebc14bcd65bd021c1dcf8e935cd096101a3a86cedbd24a917cfade2
|
|
| MD5 |
7330c486036e1a81a6781a646dbd6584
|
|
| BLAKE2b-256 |
271a87a55241ff496f1fd5766e2caeca6a1a44f94b7c63767a5210ad15ceefe0
|
Provenance
The following attestation bundles were made for fwu-0.0.3.tar.gz:
Publisher:
python-publish.yml on PsycheHalo/FWU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fwu-0.0.3.tar.gz -
Subject digest:
9e9a37c41ebc14bcd65bd021c1dcf8e935cd096101a3a86cedbd24a917cfade2 - Sigstore transparency entry: 329901901
- Sigstore integration time:
-
Permalink:
PsycheHalo/FWU@384b738e77c6c9b0cebee4562b9338057890f677 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/PsycheHalo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@384b738e77c6c9b0cebee4562b9338057890f677 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fwu-0.0.3-py3-none-any.whl.
File metadata
- Download URL: fwu-0.0.3-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ff1bfda9710527f272d2262246325cb2e64921dbbbab2042c9d8e5aac9a9c0
|
|
| MD5 |
107a53b27814c7bcca1fb373b7d7d678
|
|
| BLAKE2b-256 |
4cb2670e24757755c2c6c788627cb38c5e9f81e993677975c0e054fc3ab3c838
|
Provenance
The following attestation bundles were made for fwu-0.0.3-py3-none-any.whl:
Publisher:
python-publish.yml on PsycheHalo/FWU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fwu-0.0.3-py3-none-any.whl -
Subject digest:
89ff1bfda9710527f272d2262246325cb2e64921dbbbab2042c9d8e5aac9a9c0 - Sigstore transparency entry: 329901923
- Sigstore integration time:
-
Permalink:
PsycheHalo/FWU@384b738e77c6c9b0cebee4562b9338057890f677 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/PsycheHalo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@384b738e77c6c9b0cebee4562b9338057890f677 -
Trigger Event:
release
-
Statement type: