Skip to main content

Generate torch models from yaml config files.

Reason this release was yanked:

unmaintained

Project description

yaml-models

Python package generating torch models from a yaml configuration file. Each type item in model list need to specify at minimum the default values needed by the torch.nn module. Arguments not specified will use the default values.

Example config:

model:
-   type: Linear
    in_features: 2
    out_features: 10
-   type: ReLU
-   type: Linear
    in_features: 10
    out_features: 1
-   type: Sigmoid

torch.nn.Linear needs the default arguments in_features and out_features.

Usage

pip install yaml-models
>>> from yaml_models.model import Model
>>> model = Model(config_path="./example_config/model.yaml")
>>> print(model)
Model(
  (layers): ModuleList(
    (0): Linear(in_features=2, out_features=10, bias=True)
    (1): ReLU()
    (2): Linear(in_features=10, out_features=1, bias=True)
    (3): Sigmoid()
  )
)

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

yaml_models-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

yaml_models-0.1.0-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file yaml_models-0.1.0.tar.gz.

File metadata

  • Download URL: yaml_models-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for yaml_models-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cab68144f892ea7bb1c4068b25937d99deb7163031d3640d02325a3e8fe16dff
MD5 0b94b016bd822a889bf9c3f000c7f9c5
BLAKE2b-256 9b6369898d5517c03fe85edef7779978da07caeb00c60b4bb71e4a41d0cf4291

See more details on using hashes here.

File details

Details for the file yaml_models-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: yaml_models-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for yaml_models-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f5767939346012d98d47611d08f7fbd934575718cc720cc5b3ac3246b83dcac7
MD5 572ec663a7112d657d424ddb066f86c1
BLAKE2b-256 f6728a6109ca829445871f26ee7da9a5dbca6d057902c7e9988eb85d1679c333

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