Skip to main content

API to compose PyTorch neural networks on the fly.

Project description

Torch-Nets

PyPI pyversions PyPI version Code style: black

ol-reliable-spongebob

Compose PyTorch neural networks with ease.

Installation

From PYPI (current version: v0.0.3rc1)

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.0.3rc1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

torch_nets-0.0.3rc1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file torch-nets-0.0.3rc1.tar.gz.

File metadata

  • Download URL: torch-nets-0.0.3rc1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for torch-nets-0.0.3rc1.tar.gz
Algorithm Hash digest
SHA256 d9b36f5a4bd0cabb3bdbe62211a0a1b14e2205fa8ad8995de00ef4a2b5326f0b
MD5 9379d6080d10e61c1aa6e0833feaaa31
BLAKE2b-256 2c698c0f49c0d7d97fe0e08609a4d26ab4ec098afff5e64750304e6f784d22a1

See more details on using hashes here.

File details

Details for the file torch_nets-0.0.3rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_nets-0.0.3rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 152b89f7a1ee58fa90cb7277bf45bb1eaaf2beec1cfdc7ff6a7e1f71cc727b67
MD5 675c2f55278d27b032b0bf5d37561969
BLAKE2b-256 187db32f8b8d4b25b9625b12cfe07a37c5613f7a2b682b8226542ad3160b2749

See more details on using hashes here.

Supported by

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