API to compose PyTorch neural networks on the fly.
Project description
Torch-Nets
Compose PyTorch neural networks with ease.
Installation
From PYPI (current version: v0.0.1
)
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-case
from torch_nets import TorchNet
Create a feed-forward neural network
net = TorchNet(
in_features=50,
out_features=50,
hidden=[400, 400],
activation="LeakyReLU",
dropout=0.2,
n_augment=0,
bias=True,
output_bias=True,
)
net
Sequential(
(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)
)
)
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.
Potential future plans
- Composition of
torch.optim
funcs.
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.2.tar.gz
(19.3 kB
view details)
Built Distribution
File details
Details for the file torch-nets-0.0.2.tar.gz
.
File metadata
- Download URL: torch-nets-0.0.2.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3c13265e6d3c5089f103e72b874836e10e8ace241a7b1cc31e0a6bc40f0c0a |
|
MD5 | b6d18bc444d9268fcecc705a6582d12a |
|
BLAKE2b-256 | 9f7040cec6f3097f012cdb4e747a344b8cf51ca757c3ce1a37e0b9cc39c87132 |
File details
Details for the file torch_nets-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: torch_nets-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1843273e263b2fb59dc33058cc5b135ff9e93fd200f37bc6bfaf32f387851fe8 |
|
MD5 | db8784699df12dfc8bd56a8a8a00153d |
|
BLAKE2b-256 | 26b28774b0533f12189b69a9b11cf5b39958254bfd8d58c9f2eb23ab4f10f414 |