Name | fish-nnpipeline JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | Neural Network Pipeline that helps you to build intricate network more easy way. |
upload_time | 2025-01-30 13:12:45 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4.0,>=3.10 |
license | Copyright <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
torch
machine-learning
builder
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Neural Network Pipeline
Simple network building pipeline for PyTorch. (torch>=2.1,<2.2)
## How to start?
1. install `pip install fish-nnpipeline` and `import nnpipeline`
2. create a pipe base object. (ex: `layer = nnpipeline.LinearExponentialEncoder(10, 5))
3. chain it to `torch.nn.sequential` or do whatever you want. all pipeline object follows `torch.nn.Module`..
(at least `forward` method exists.)
## Explain of each pipeline object
1. Layers
1.1. `LinearExponentialEncoder` : Generate linear layers semi-automatically. You should give `in_features`, `out_features` and the class do the rest.
You can control narrowing node ratio by `compression_rate` parameter. (default 0.618) Also can use noramlization, dropout.
You cannot alter order between linear and others like norm, activation, dropout. It has been fixed (linear -> norm -> activation -> dropout) because I'm super lazy.
```aiignore
lee = LinearExponentialEncoder(100, 34)
```
```aiignore
# what lee is..
LinearExponentialEncoder(
(layers): Sequential(
(0): Linear(in_features=100, out_features=61, bias=True)
(1): BatchNorm1d(61, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
(3): Linear(in_features=61, out_features=37, bias=True)
(4): BatchNorm1d(37, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(5): ReLU()
(6): Linear(in_features=37, out_features=34, bias=True)
(7): BatchNorm1d(34, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(8): ReLU()
)
)
```
1.2. `LinearExponentialDecoder` : Encoder is narrowing down linear nodes. Decoder is expanding nodes. It's like a mirror of encoder.
Those linear encoder/decoder work based on exponentially inceasing/decreasing sequence that start from `in_features` to `out_features`. As you can see above example of `lee`, it works just like normal torch.nn.Module object. So you can put this in `nn.Sequential` or something.
1.3. `LinearCylinder` : Cylinder is a simple multi-layer module that has same input, output features. It looks just like a cylinder so the name is also cylinder.
2. Glues
2.1. `LinearJoint` LYou can concatenate multiple pipeline output to one single pipeline using `torch.cat`. yes you can do this by yourself, but I prefer this way more.
3. Compositions
3.1. `LinearExponentialComposition`: You can direcly use multiple pipes and join them manually, or you can simply define COMPOSITION class.
```aiignore
l1 = LinearExponentialEncoder(100, 35)
l2 = LinearExponentialEncoder(150, 40)
l3 = LinearExponentialEncoder(120, 30)
lec = LinearExponentialComposition([l1, l2, l3], 80)
print(lec)
```
```aiignore
# I'm lec!
LinearExponentialComposition(
(pipes): ModuleList(
(0): LinearExponentialEncoder(
(layers): Sequential(
(0): Linear(in_features=100, out_features=61, bias=True)
...
(8): ReLU()
)
)
(1): LinearExponentialEncoder(
(layers): Sequential(
(0): Linear(in_features=150, out_features=92, bias=True)
...
(8): ReLU()
)
)
(2): LinearExponentialEncoder(
(layers): Sequential(
(0): Linear(in_features=120, out_features=74, bias=True)
...
(8): ReLU()
)
)
)
(joint): LinearJoint()
(encoder): LinearExponentialEncoder(
(layers): Sequential(
(0): Linear(in_features=105, out_features=80, bias=True)
(1): BatchNorm1d(80, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
)
)
)
```
4. No more contents. I'm lazy. I'll add more later.
Raw data
{
"_id": null,
"home_page": null,
"name": "fish-nnpipeline",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "torch, machine-learning, builder",
"author": null,
"author_email": "\uc548\ud615\uc900 <gatesplan@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c7/c5/2125d19f26ce4db7584d22a7a7be1541e0e253910d19bf93ce98aec4c5cf/fish_nnpipeline-0.0.2.tar.gz",
"platform": null,
"description": "# Neural Network Pipeline\r\n\r\nSimple network building pipeline for PyTorch. (torch>=2.1,<2.2)\r\n\r\n\r\n## How to start?\r\n\r\n1. install `pip install fish-nnpipeline` and `import nnpipeline`\r\n\r\n2. create a pipe base object. (ex: `layer = nnpipeline.LinearExponentialEncoder(10, 5))\r\n\r\n3. chain it to `torch.nn.sequential` or do whatever you want. all pipeline object follows `torch.nn.Module`..\r\n (at least `forward` method exists.)\r\n\r\n\r\n## Explain of each pipeline object\r\n\r\n1. Layers\r\n\r\n1.1. `LinearExponentialEncoder` : Generate linear layers semi-automatically. You should give `in_features`, `out_features` and the class do the rest.\r\n\r\nYou can control narrowing node ratio by `compression_rate` parameter. (default 0.618) Also can use noramlization, dropout.\r\n\r\nYou cannot alter order between linear and others like norm, activation, dropout. It has been fixed (linear -> norm -> activation -> dropout) because I'm super lazy.\r\n\r\n```aiignore\r\nlee = LinearExponentialEncoder(100, 34)\r\n```\r\n\r\n```aiignore\r\n# what lee is..\r\nLinearExponentialEncoder(\r\n (layers): Sequential(\r\n (0): Linear(in_features=100, out_features=61, bias=True)\r\n (1): BatchNorm1d(61, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\r\n (2): ReLU()\r\n (3): Linear(in_features=61, out_features=37, bias=True)\r\n (4): BatchNorm1d(37, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\r\n (5): ReLU()\r\n (6): Linear(in_features=37, out_features=34, bias=True)\r\n (7): BatchNorm1d(34, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\r\n (8): ReLU()\r\n )\r\n)\r\n```\r\n\r\n1.2. `LinearExponentialDecoder` : Encoder is narrowing down linear nodes. Decoder is expanding nodes. It's like a mirror of encoder.\r\n\r\nThose linear encoder/decoder work based on exponentially inceasing/decreasing sequence that start from `in_features` to `out_features`. As you can see above example of `lee`, it works just like normal torch.nn.Module object. So you can put this in `nn.Sequential` or something.\r\n\r\n1.3. `LinearCylinder` : Cylinder is a simple multi-layer module that has same input, output features. It looks just like a cylinder so the name is also cylinder.\r\n\r\n\r\n2. Glues\r\n\r\n2.1. `LinearJoint` LYou can concatenate multiple pipeline output to one single pipeline using `torch.cat`. yes you can do this by yourself, but I prefer this way more.\r\n\r\n\r\n3. Compositions\r\n\r\n3.1. `LinearExponentialComposition`: You can direcly use multiple pipes and join them manually, or you can simply define COMPOSITION class.\r\n\r\n```aiignore\r\nl1 = LinearExponentialEncoder(100, 35)\r\nl2 = LinearExponentialEncoder(150, 40)\r\nl3 = LinearExponentialEncoder(120, 30)\r\n\r\nlec = LinearExponentialComposition([l1, l2, l3], 80)\r\nprint(lec)\r\n```\r\n\r\n```aiignore\r\n# I'm lec!\r\nLinearExponentialComposition(\r\n (pipes): ModuleList(\r\n (0): LinearExponentialEncoder(\r\n (layers): Sequential(\r\n (0): Linear(in_features=100, out_features=61, bias=True)\r\n ...\r\n (8): ReLU()\r\n )\r\n )\r\n (1): LinearExponentialEncoder(\r\n (layers): Sequential(\r\n (0): Linear(in_features=150, out_features=92, bias=True)\r\n ...\r\n (8): ReLU()\r\n )\r\n )\r\n (2): LinearExponentialEncoder(\r\n (layers): Sequential(\r\n (0): Linear(in_features=120, out_features=74, bias=True)\r\n ...\r\n (8): ReLU()\r\n )\r\n )\r\n )\r\n (joint): LinearJoint()\r\n (encoder): LinearExponentialEncoder(\r\n (layers): Sequential(\r\n (0): Linear(in_features=105, out_features=80, bias=True)\r\n (1): BatchNorm1d(80, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\r\n (2): ReLU()\r\n )\r\n )\r\n)\r\n```\r\n\r\n4. No more contents. I'm lazy. I'll add more later.\r\n",
"bugtrack_url": null,
"license": "Copyright <YEAR> <COPYRIGHT HOLDER>\r\n \r\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n \r\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n \r\n THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Neural Network Pipeline that helps you to build intricate network more easy way.",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/gatesplan/nnpipeline",
"Issues": "https://github.com/gatesplan/nnpipeline/issues"
},
"split_keywords": [
"torch",
" machine-learning",
" builder"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e64568c4b6dab19d50325961dc8f184a2fd6ce46a5d4ec669a29641a5ff64487",
"md5": "b3ea14d89220fbceb22b173baddd3273",
"sha256": "fc9328279e63d278f1a5640f9636d787d3e6a5688447cd3738d10c93236826bc"
},
"downloads": -1,
"filename": "fish_nnpipeline-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b3ea14d89220fbceb22b173baddd3273",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 11107,
"upload_time": "2025-01-30T13:12:44",
"upload_time_iso_8601": "2025-01-30T13:12:44.469627Z",
"url": "https://files.pythonhosted.org/packages/e6/45/68c4b6dab19d50325961dc8f184a2fd6ce46a5d4ec669a29641a5ff64487/fish_nnpipeline-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c7c52125d19f26ce4db7584d22a7a7be1541e0e253910d19bf93ce98aec4c5cf",
"md5": "9619dbe74a6956ade6b54da1cb76f2ad",
"sha256": "7db7dc06dd4d657aa0bb51cc4f90e23447bad2603cdc6bd75cb364037efe6d5a"
},
"downloads": -1,
"filename": "fish_nnpipeline-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "9619dbe74a6956ade6b54da1cb76f2ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 7486,
"upload_time": "2025-01-30T13:12:45",
"upload_time_iso_8601": "2025-01-30T13:12:45.563145Z",
"url": "https://files.pythonhosted.org/packages/c7/c5/2125d19f26ce4db7584d22a7a7be1541e0e253910d19bf93ce98aec4c5cf/fish_nnpipeline-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-30 13:12:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gatesplan",
"github_project": "nnpipeline",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fish-nnpipeline"
}