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.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,
    n_augment=0,
    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


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

Uploaded Source

Built Distribution

torch_nets-0.0.2rc0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torch-nets-0.0.2rc0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for torch-nets-0.0.2rc0.tar.gz
Algorithm Hash digest
SHA256 92c1363517028bf6bb3d891092a595b004f16194ecd8febebd92cf15d6f0e9f7
MD5 eac1317e4dd869dd28aab1799afb31a6
BLAKE2b-256 b91e695b6f44473b4f59ae52d78d423e50f245c56e41e1fce810826ac3943607

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_nets-0.0.2rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ee478548c2d5f13f95f4d11b07633a57f37113baa60e9e875e70e19f412915
MD5 453da7866facecfd0f72aa5321a15457
BLAKE2b-256 35630f932166133f10328186590f87a38249f6f9fcf550198fe3cb5520c6e8ec

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