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.4rc0)

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.4rc0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

torch_nets-0.0.4rc0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file torch-nets-0.0.4rc0.tar.gz.

File metadata

  • Download URL: torch-nets-0.0.4rc0.tar.gz
  • Upload date:
  • Size: 22.7 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.4rc0.tar.gz
Algorithm Hash digest
SHA256 6cd842a6c513a9c442a06290b7c4b2869688d4e67ce15560ec14484ed3e72e75
MD5 a0be1feed61b689dd752f6d145494402
BLAKE2b-256 fdd9f8131e88f8764c111beef91ad83225d5554d2acce07dcb73c5b040274fc4

See more details on using hashes here.

File details

Details for the file torch_nets-0.0.4rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_nets-0.0.4rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 a76024ec0094e3a63b031051daffbae39c9cf0bba5fc1cb874652507036a481b
MD5 d15b9ead15ce3ba955f657b09917a788
BLAKE2b-256 ee1743742c5afa8f2ff77fe0bcd16bb79162481e654c6cf27c0096dcce5f2d24

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