Skip to main content

Automatic threshold optimization

Project description

Autoth: Automatic optimzie hyper parameters

Autoth is a Python toolbox to automatically optimize hyper parameters to maximize scores. For example, Autoth can optimize hyper parameters to maximize F1 score in a classification task. In practice, Autoth numerically calculate gradients of scores over hyper parameters. Then, the hyper parameters are updated according to the gradients iteratively. Please see [1] for details.

Install

pip install autoth

Example

python3 example.py

Results

------ Manually selected hyper parameters ------
Hyper parameters: [0.3, 0.3, 0.3]
Score: 0.5556

------ Automatic optimized hyper parameters ------
Optimizing hyper parameters ...
learning rate: 0.010, total epochs: 10
    Hyper parameters: [0.3, 0.31, 0.29], score: 0.5556
    Epoch: 0, Time: 0.0181 s
    Hyper parameters: [0.3, 0.3197, 0.2801], score: 0.5556
    Epoch: 1, Time: 0.0178 s
    Hyper parameters: [0.3, 0.3237, 0.2702], score: 0.5714
    Epoch: 2, Time: 0.0212 s
    Hyper parameters: [0.3, 0.3245, 0.263], score: 0.6099
    Epoch: 3, Time: 0.0144 s
    Hyper parameters: [0.3, 0.3232, 0.2548], score: 0.6099
    Epoch: 4, Time: 0.0142 s
    Hyper parameters: [0.3, 0.3204, 0.2464], score: 0.6099
    Epoch: 5, Time: 0.0151 s
    Hyper parameters: [0.3, 0.3164, 0.2382], score: 0.6099
    Epoch: 6, Time: 0.0159 s
    Hyper parameters: [0.3, 0.316, 0.2302], score: 0.5940
    Epoch: 7, Time: 0.0143 s
    Hyper parameters: [0.3, 0.318, 0.2226], score: 0.5940
    Epoch: 8, Time: 0.0150 s
    Hyper parameters: [0.3, 0.3186, 0.2152], score: 0.6099
    Epoch: 9, Time: 0.0177 s

Optimized hyper parameters: [0.3, 0.3186, 0.2152]
Score: 0.6099

Cite

[1] Kong, Qiuqiang, Yong Xu, Wenwu Wang, and Mark D. Plumbley. "Sound Event Detection of Weakly Labelled Data with CNN-Transformer and Automatic Threshold Optimization." arXiv preprint arXiv:1912.04761 (2019).

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

autoth-qiuqiangkong-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

autoth_qiuqiangkong-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file autoth-qiuqiangkong-0.0.1.tar.gz.

File metadata

  • Download URL: autoth-qiuqiangkong-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for autoth-qiuqiangkong-0.0.1.tar.gz
Algorithm Hash digest
SHA256 61a3de95bb6b6466206f5bef8d7455b5055f245edb16c0609fce5a8f7ed18edb
MD5 e0340327996fb61dfd61fb765b15ea44
BLAKE2b-256 b94c1fb5fd1f4568b24f54b5ad369f647f99b8f470866d9d56e807429c298559

See more details on using hashes here.

File details

Details for the file autoth_qiuqiangkong-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: autoth_qiuqiangkong-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for autoth_qiuqiangkong-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 111d7c2a016e5a6600a024347971f9e6548b65933d24cef33867893894581b7f
MD5 38a6cb10d381554e7d25a4c5bf890ca7
BLAKE2b-256 2dc5f44f3f9516d6b2a149e1daef220a482b645775fcb60e46221b6c3ef84077

See more details on using hashes here.

Supported by

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