Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"]
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']
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()
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"]
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"]
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.
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"]
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"]