Skip to main content

logo

PyPI pyversions PyPI version Code style: black

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.

Problem? Open an issue or get in touch via email.

Metadata

Release files for torch-nets 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-nets 0.2.1
File Size Uploaded
torch_nets-0.2.1.tar.gz 23.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-nets 0.2.1
File Interpreter ABI Platform
torch_nets-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.9 kB

Release files / torch_nets-0.2.1.tar.gz

Download URL torch_nets-0.2.1.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba8979a1d326a957505c33e386c71fd35d1e34b577e541aaebbf8b59baf63e8
BLAKE2b-256 checksum
How to use checksums
56ddf99b984a66b9382b1c777231adb45f3c29c3a65a249e2d18f4ed041d96fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / torch_nets-0.2.1-py3-none-any.whl

Download URL torch_nets-0.2.1-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2235cc91fadb7de7e8d408101939613991ed4e59d2b025e208e27318b78df61e
BLAKE2b-256 checksum
How to use checksums
709df0a07771d04c07961b99b66d658d1656b24acd42f18051985a9d4349e327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page