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,
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.1.tar.gz
(18.6 kB
view details)
Built Distribution
File details
Details for the file torch-nets-0.0.1.tar.gz
.
File metadata
- Download URL: torch-nets-0.0.1.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1abd49d5e934249117695bae321fed8607e7de881f0e045056e59c823c52f4e5 |
|
MD5 | 115c22487ca3bb90b90ae3a37366b509 |
|
BLAKE2b-256 | a26b4f2c99b897858106df8fb913472897342459294f6e5774a92daa67fe6b73 |
File details
Details for the file torch_nets-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: torch_nets-0.0.1-py3-none-any.whl
- Upload date:
- Size: 20.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 | 6b6ac6997a19b7c167c1a4d731b274db5bf705b02683e43e8f3b1423404dd582 |
|
MD5 | a2f2fd5df6a1e820d42c93d0464cdfd1 |
|
BLAKE2b-256 | cf06eb3390d034f2b48a154e033e8d1018f34a4280e62ebf4ab5ff11b008f077 |