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.1.0rc1.tar.gz
(22.8 kB
view details)
Built Distribution
File details
Details for the file torch-nets-0.1.0rc1.tar.gz
.
File metadata
- Download URL: torch-nets-0.1.0rc1.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8fe7f614352b85e17ed8dbb7dff0d373383794ed77cd23305700ea03177df1a |
|
MD5 | 4aa158ca8c8238410d98e49c2e819bd4 |
|
BLAKE2b-256 | 0e58a89cade5ff4e94ad08a52253759bf67e1cbe954597380327fb7429823017 |
File details
Details for the file torch_nets-0.1.0rc1-py3-none-any.whl
.
File metadata
- Download URL: torch_nets-0.1.0rc1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1fb11703a901a2afa34e56f8225a7b971ec2d28c8b0e28f4b31f726e9973cdd |
|
MD5 | 6857891ce616360bb04f670485067c40 |
|
BLAKE2b-256 | 002f6343d4d3d91a419564f441c8dceef3f98ad070bf68820db57c6530d0e4fe |