matsci_opt_benchmarks.crabnet_hyperparameter package

Submodules

matsci_opt_benchmarks.crabnet_hyperparameter.core module

This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following lines in the [options.entry_points] section in setup.cfg:

console_scripts =
     fibonacci = crabnet_hyperparameter.skeleton:run

Then run pip install . (or pip install -e . for editable mode) which will install the command fibonacci inside your current environment.

Besides console scripts, the header (i.e. until _logger…) of this file can also be used as template for Python modules.

Note

This file can be renamed depending on your needs or safely removed if not needed.

References

matsci_opt_benchmarks.crabnet_hyperparameter.core.correct_parameterization(parameters: dict, verbose=False)[source]

Modify tunable hyperparameters for combatibility with CrabNet.

Parameters:
  • parameters (dict) – Hyperparameter set used by Ax in optimization.

  • verbose (bool, optional) – Print function progress. Defaults to False.

Returns:

Modified dictionary with the correct parameters for CrabNet compatibility.

Return type:

dict

matsci_opt_benchmarks.crabnet_hyperparameter.core.evaluate(parameters)[source]

Trains CrabNet using the inputted parameter set and records the results.

Parameters:

parameters (list(dict)) – Hyperparameter set for CrabNet.

Returns:

Results after CrabNet training. MAE, RMSE, Model Size, Runtime. If there is an error, dict contains error at dict[“error”]

Return type:

dict

matsci_opt_benchmarks.crabnet_hyperparameter.core.fib(n)[source]

Fibonacci example function

Parameters:

n (int) – integer

Returns:

n-th Fibonacci number

Return type:

int

matsci_opt_benchmarks.crabnet_hyperparameter.core.get_parameters()[source]

Get parameter set and parameter constraints for CrabNet.

Returns:

CrabNet parameters, CrabNet parameter contraints for Ax

Return type:

(list(dict), list)

matsci_opt_benchmarks.crabnet_hyperparameter.core.main(args)[source]

Wrapper allowing fib() to be called with string arguments in a CLI fashion

Instead of returning the value from fib(), it prints the result to the stdout in a nicely formatted message.

Parameters:

args (List[str]) – command line parameters as list of strings (for example ["--verbose", "42"]).

matsci_opt_benchmarks.crabnet_hyperparameter.core.parse_args(args)[source]

Parse command line parameters

Parameters:

args (List[str]) – command line parameters as list of strings (for example ["--help"]).

Returns:

command line parameters namespace

Return type:

argparse.Namespace

matsci_opt_benchmarks.crabnet_hyperparameter.core.run()[source]

Calls main() passing the CLI arguments extracted from sys.argv

This function can be used as entry point to create console scripts with setuptools.

matsci_opt_benchmarks.crabnet_hyperparameter.core.setup_logging(loglevel)[source]

Setup basic logging

Parameters:

loglevel (int) – minimum loglevel for emitting messages

Module contents