Skip to main content

API to compose PyTorch neural networks on the fly.

Project description

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.

Project details


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.2.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torch_nets-0.2.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file torch_nets-0.2.0.tar.gz.

File metadata

  • Download URL: torch_nets-0.2.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for torch_nets-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6239a8617ec7e02ad902349ef37441772ad7a119ba7c802fb394a1c71acbd385
MD5 d38bd554391ca1dc8dd4eb32e1308f94
BLAKE2b-256 aecd764cfce314900d4fbd961848eb7bb72f1d6e759cf94f75f1f783fb574590

See more details on using hashes here.

File details

Details for the file torch_nets-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: torch_nets-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for torch_nets-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b7e4090dad91a87301c2bdc5b40793ba7257346abca0fd3dce0505194aeb2a
MD5 e91a80da81c4168964ae61d72d4ec9cf
BLAKE2b-256 9a81314bc78d0e638517228cd8d0dc3f2dfb267fb3c2203079474f7a5a68aeff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page