a compact neuron network model definition grammar
Project description
NEURLINK
A compact grammar for neural network definition based on PyTorch.
Basics
- Nodes:
(c, s, o)
: tensor (channel_size, downsample_scale, operation),((c1, s1), (c2, s2), ..., o)
or((c, s, o),)*n
: parallel tensors,[(c, s, o)]*n
: sequential tensors,
- Ordered nodes form a graph. Each node has an operation (also known as transform function) that converts one or more previous tensors to (a) new tensor(s). Defining new operations requires some specific arguments and a decorator.
Example (resnet)
def resnet50(num_classes: int = 1000, **block_keywords):
block = BottleNeck(**block_keywords)
expansion = 4
return build(
[
(3, 1, None),
(64, 2, ConvLayer(7)),
(64, 4, MaxPool2d(3)),
[(64 * expansion, 4, block)] * 3,
[(128 * expansion, 8, block)] * 4,
[(256 * expansion, 16, block)] * 6,
[(512 * expansion, 32, block)] * 3,
(512 * expansion, "(1, 1)", AvgPool2d()),
(num_classes, None, ConvLayer(1, norm=nn.Identity, act=nn.Identity)),
]
)
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
neurlink-0.1.0.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file neurlink-0.1.0.tar.gz
.
File metadata
- Download URL: neurlink-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2fcf0c27fae872c07ec5dac6bf2cfedda37f2cb37d4bfaced8778cb5a34a85 |
|
MD5 | af5527dbc21c6453b79948c2eda14817 |
|
BLAKE2b-256 | 03c4b9dca454784decbb608e937a6c93cf3356e85130f196623c4d9f4ee10703 |
File details
Details for the file neurlink-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: neurlink-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 031eb45c71c1ab2b0c7f417dea293afdc3197f6010503f8ee5d987c1da138ba0 |
|
MD5 | e7bcf16d3e8d78040b3a22c3c2b54bb4 |
|
BLAKE2b-256 | aa278b090188369a4b14f9f864d36c1545c59598159c84e9223d91856d543b05 |