How to use the deephyper.benchmarks_hps.util.handle_cli function in deephyper

To help you get started, we’ve selected a few deephyper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deephyper / deephyper / deephyper / benchmarks_hps / imdbbl / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the imdb_bidirectional_lstm benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the parsed param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters
    BATCH_SIZE     = param_dict["batch_size"]
    DROPOUT        = param_dict["dropout"]
    EMBEDDING_DIMS = param_dict["embedding_dims"]
    EPOCHS         = param_dict["epochs"]
    MAX_FEATURES   = param_dict["max_features"]
    MAXLEN         = param_dict["maxlen"]
    OPTIMIZER      = util.get_optimizer_instance(param_dict)
    UNITS          = param_dict["units"]
github deephyper / deephyper / deephyper / benchmarks_hps / cifar10_resnet_v2 / main.py View on Github external
def run(param_dict={}, verbose=2):
    """Run a param_dict on the MNISTCNN benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    util.handle_cli(param_dict, build_parser())
    
    # Display the filled in param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters

    # Training parameters
    ACTIVATION          = param_dict['activation']
    BATCH_SIZE          = param_dict["batch_size"] #=32
    BASE_LR             = param_dict['base_lr']
    DATA_AUG            = param_dict['data_augmentation']
    EPOCHS              = param_dict['epochs']
    KERNEL_SIZE         = param_dict['kernel_size']
github deephyper / deephyper / deephyper / benchmarks_hps / mnisthrnn / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the MNISTCNN benchmark."""
    # Read in values from CLI if no param_dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the filled in param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)
    
    timer.start('stage in')
    if param_dict['data_source']:
        data_source = param_dict['data_source']
    else:
        data_source = os.path.dirname(os.path.abspath(__file__))
        data_source = os.path.join(data_source, 'data')

    (x_train, y_train), (x_test, y_test) = mnist.load_data()

    timer.end()
github deephyper / deephyper / deephyper / benchmarks_hps / cifar10cnn / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the cifar10 benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the parsed param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters
    ACTIVATION1       = util.get_activation_instance(param_dict['activation1'], param_dict['alpha1'])
    ACTIVATION2       = util.get_activation_instance(param_dict['activation2'], param_dict['alpha2'])
    ACTIVATION3       = util.get_activation_instance(param_dict['activation3'], param_dict['alpha3'])
    ACTIVATION4       = util.get_activation_instance(param_dict['activation4'], param_dict['alpha4'])
    ACTIVATION5       = util.get_activation_instance(param_dict['activation5'], param_dict['alpha5'])
    BATCH_SIZE        = param_dict["batch_size"]
    DATA_AUGMENTATION = param_dict["data_augmentation"]
    DROPOUT           = param_dict["dropout"]
github deephyper / deephyper / deephyper / benchmarks / reutersmlp_hps / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the reutersmlp benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the parsed param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters
    ACTIVATION    = util.get_activation_instance(param_dict)
    BATCH_SIZE    = param_dict["batch_size"]
    DROPOUT       = param_dict["dropout"]
    EPOCHS        = param_dict["epochs"]
    MAX_WORDS     = param_dict["max_words"]
    NUNITS        = param_dict["nunits"]
    OPTIMIZER     = util.get_optimizer_instance(param_dict)
    SKIP_TOP      = param_dict["skip_top"]
github deephyper / deephyper / deephyper / benchmarks_hps / imdbcnn / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the imdbcnn benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the filled in param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    timer.start("stage in")

    # Kept for future implementation of external data loading.
    # if param_dict["data_source"]:
    #     data_source = param_dict["data_source"]
    # else:
    #     data_source = os.path.dirname(os.path.abspath(__file__))
    #     data_source = os.path.join(data_source, "data")

    # Get arguments from param_dict.
github deephyper / deephyper / deephyper / benchmarks_hps / mnistcnn / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the MNISTCNN benchmark."""
    # Read in values from CLI if no param_dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the filled in param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters
    ACTIVATION1    = util.get_activation_instance(param_dict['activation1'], param_dict['alpha1'])
    ACTIVATION2    = util.get_activation_instance(param_dict['activation2'], param_dict['alpha2'])
    ACTIVATION3    = util.get_activation_instance(param_dict['activation3'], param_dict['alpha3'])
    ACTIVATION4    = util.get_activation_instance(param_dict['activation4'], param_dict['alpha4'])
    ACTIVATION5    = util.get_activation_instance(param_dict['activation5'], param_dict['alpha5'])
    BATCH_SIZE    = param_dict["batch_size"]
    DROPOUT       = param_dict["dropout"]
    EPOCHS        = param_dict["epochs"]
github deephyper / deephyper / deephyper / benchmarks_hps / reutersmlp / main.py View on Github external
def run(param_dict=None, verbose=2):
    """Run a param_dict on the reutersmlp benchmark."""
    # Read in values from CLI if no param dict was specified and clean up the param dict.
    param_dict = util.handle_cli(param_dict, build_parser())

    # Display the parsed param dict.
    if verbose:
        print("PARAM_DICT_CLEAN=")
        pprint(param_dict)

    # Get values from param_dict.
    # Hyperparameters
    ACTIVATION1    = util.get_activation_instance(param_dict["activation1"], param_dict["alpha1"])
    ACTIVATION2    = util.get_activation_instance(param_dict["activation2"], param_dict["alpha2"])
    ACTIVATION3    = util.get_activation_instance(param_dict["activation3"], param_dict["alpha3"])
    ACTIVATION4    = util.get_activation_instance(param_dict["activation4"], param_dict["alpha4"])
    ACTIVATION5    = util.get_activation_instance(param_dict["activation5"], param_dict["alpha5"])
    BATCH_SIZE    = param_dict["batch_size"]
    DROPOUT       = param_dict["dropout"]
    EPOCHS        = param_dict["epochs"]