https://github.com/adeelh/pytorch-sequential-helpers
Some helper PyTorch modules that allow complex networks to be expressed as Sequentials
https://github.com/adeelh/pytorch-sequential-helpers
deep-learning neural-network neural-networks pytorch
Last synced: about 1 month ago
JSON representation
Some helper PyTorch modules that allow complex networks to be expressed as Sequentials
- Host: GitHub
- URL: https://github.com/adeelh/pytorch-sequential-helpers
- Owner: AdeelH
- License: mit
- Created: 2019-08-18T01:02:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T13:50:50.000Z (almost 6 years ago)
- Last Synced: 2025-04-11T15:09:57.157Z (about 1 year ago)
- Topics: deep-learning, neural-network, neural-networks, pytorch
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pytorch-sequential-helpers
Some helper modules that allow complex networks (particulary those with parallel data flows) to be expressed as a single Sequential.
# Example
**Pass same input to 2 different NN branches and merge the results by adding**
```{python3}
nn.Sequential(
Parallel(branch1, branch2),
Add()
)
```
**Split the RGB channels of a batch of images, pass each to a different NN branch, and concat the results**
```{python3}
nn.Sequential(
Split((1, 1, 1), dim=1),
Parallel(branch1, branch2, branch3),
Concat(dim=1)
)
```