API to compose PyTorch neural networks on the fly.
Project description
Compose PyTorch neural networks with ease.
Installation
From PYPI (current version: v0.0.5
)
pip install torch-nets
Alternatively, install the development version from GitHub:
git clone https://github.com/mvinyard/torch-nets.git;
cd torch-nets; pip install -e .
Example API use-cases
from torch_nets import TorchNet
Create a feed-forward neural network
The only required arguments are in_features
and out_features
. The network can be made as simple or complex as you want through optional parameters.
net = TorchNet(
in_features=50,
out_features=50,
hidden=[400, 400],
activation="LeakyReLU",
dropout=0.2,
bias=True,
output_bias=True,
)
See output
TorchNet(
(hidden_1): Sequential(
(linear): Linear(in_features=50, out_features=400, bias=True)
(dropout): Dropout(p=0.2, inplace=False)
(activation): LeakyReLU(negative_slope=0.01)
)
(hidden_2): Sequential(
(linear): Linear(in_features=400, out_features=400, bias=True)
(dropout): Dropout(p=0.2, inplace=False)
(activation): LeakyReLU(negative_slope=0.01)
)
(output): Sequential(
(linear): Linear(in_features=400, out_features=50, bias=True)
)
)
Documentation
For more information, including examples of additional use-cases please visit the documentation (coming soon)! Additional use-cases include: Encoder
, Decoder
, AugmentedTorchNet
.
Potential future plans
- Flexible composition of
torch.optim
funcs. - Potential
pytorch_lightning
use-cases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torch-nets-0.0.5rc0.tar.gz
(22.7 kB
view details)
Built Distribution
File details
Details for the file torch-nets-0.0.5rc0.tar.gz
.
File metadata
- Download URL: torch-nets-0.0.5rc0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d10a917ca1e03965fd260280f5ee8b9580eeff219d8f232c08bb508b59e501d |
|
MD5 | 39db33c2716507dc8a86a017ee434c7f |
|
BLAKE2b-256 | c59d686795f868f0e26aec5d3ac39e2816b619356fb2c924422ca718631e1d29 |
File details
Details for the file torch_nets-0.0.5rc0-py3-none-any.whl
.
File metadata
- Download URL: torch_nets-0.0.5rc0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6199cea1b7be66717e0bb555f89df246312b20c15b2f7f2bd5066cfbae0ac13 |
|
MD5 | c4d3ad615e6e29ad15d3a8ba83135dc9 |
|
BLAKE2b-256 | ef4dd97494bc5d94b6a0f5b9d4f180192cdfebbff8ab9ed6fb110bbd9457e05a |