Skip to main content

Sample Space Builder

Project description

from sspace import Space, either, eq
import json

space = Space(backend='ConfigSpace')

optim = space.categorical('optimizer', ['sgd', 'adam'])

sgd_lr = space.loguniform('optimizer.lr', 1, 2, quantization=0.01)
sgd_lr.enable_if(either(eq(optim, 'adam'), eq(optim, 'sgd')))
sgd_lr.forbid_equal(1)

for sample in space.sample(2):
    print(sample)

print(json.dumps(space.serialize(), indent=2))

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

sspace-0.0.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

sspace-0.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file sspace-0.0.0.tar.gz.

File metadata

  • Download URL: sspace-0.0.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for sspace-0.0.0.tar.gz
Algorithm Hash digest
SHA256 33b216581ca69b0378b625e0ba5cc74837bba0427ec524eacb3b3e63333a74ed
MD5 84f7c411d71da62068b680e3329cbc67
BLAKE2b-256 432d7b5eead81020b3e4e6afda26114338e1bcfbca7083832f46b280e9485d01

See more details on using hashes here.

File details

Details for the file sspace-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: sspace-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for sspace-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de4957a2f6b1619f8311fdcbea74eea53d36d6ebc02f7eed795786f3d01b2f6f
MD5 01197b25f4e8ca82063e3b3841ce48d6
BLAKE2b-256 5480b20ab3ba658ac1c10f9167e6a767be2476f96bc3f50ee990201a51964c14

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