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.1rc
)
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,
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.1rc0.tar.gz
(16.8 kB
view details)
Built Distribution
File details
Details for the file torch-nets-0.0.1rc0.tar.gz
.
File metadata
- Download URL: torch-nets-0.0.1rc0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14512571203cc23b669e0c7e6c6c43282f6956850b258002e5acb3f216c8cc3a |
|
MD5 | 37a0c2a6cea71441168ff76f66de123a |
|
BLAKE2b-256 | 915b08c576db1c1f79509d6b9a0394da8e65c4e8f0550c8fbf19775a627bd738 |
File details
Details for the file torch_nets-0.0.1rc0-py3-none-any.whl
.
File metadata
- Download URL: torch_nets-0.0.1rc0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3b07ecdc9bdd31aaa5b99738e13d1c00b06121bc09d1905aa801a769a8f1f6e |
|
MD5 | c7ab30f1676d56890a1db7e83fb9d380 |
|
BLAKE2b-256 | 3ba9ef2a308fad6df37bfd28e37c6a9891f38e177246e4f089cfaaa3a78562f2 |