def initialize_parameters(): print('Initializing parameters...') import os # Obtain the path of the directory of this script file_path = os.path.dirname(os.path.realpath(__file__)) # Import the CANDLE library import sys sys.path.append(candle_lib) import candle_keras as candle # Instantiate the candle.Benchmark class mymodel_common = candle.Benchmark(file_path, os.getenv("DEFAULT_PARAMS_FILE"), 'keras', prog='myprog', desc='My model') # Get a dictionary of the model hyperparamters hyperparams = candle.initialize_parameters(mymodel_common) # Return the dictionary of the hyperparameters return (hyperparams)
def initialize_parameters(): gae_common = candle.Benchmark('./', 'gae_params.txt', 'keras', prog='gae_baseline_keras2', desc='GAE Network') # Initialize parameters gParameters = default_utils.initialize_parameters(gae_common) return gParameters
def initialize_parameters(): t29_common = candle_keras.Benchmark(file_path, 't29_default_model.txt', 'keras', prog='t29res.py', desc='resnet') # Need a pointer to the docs showing what is provided # by default additional_definitions = [{ 'name': 'connections', 'default': 1, 'type': int, 'help': 'The number of residual connections.' }, { 'name': 'distance', 'default': 1, 'type': int, 'help': 'Residual connection distance between dense layers.' }, { 'name': 'model', 'default': 'model.json', 'type': str, 'help': 'Name of json model description file.' }, { 'name': 'weights', 'default': 'model.h5', 'type': str, 'help': 'Name of h5 weights file.' }, { 'name': 'n_pred', 'default': 1, 'type': int, 'help': 'Number of predictions to do on each sample.' }] t29_common.additional_definitions = additional_definitions gParameters = candle_keras.initialize_parameters(t29_common) return gParameters
def initialize_parameters(): t29_common = candle_keras.Benchmark(file_path, 't29_default_model.txt','keras', prog='/t29res.py',desc='resnet') #A list common parsed parameters are available here: https://ecp-candle.github.io/Candle/html/_modules/default_utils.html#get_common_parser additional_definitions = [ {'name':'connections', 'default':1, 'type':int, 'help':'The number of residual connections.'}, {'name':'distance', 'default':1, 'type':int, 'help':'Residual connection distance between dense layers.'} ] t29_common.additional_definitions = additional_definitions gParameters = candle_keras.initialize_parameters(t29_common) return gParameters
def initialize_parameters(): t29_common = candle_keras.Benchmark(file_path, 't29_default_model.txt','keras', prog='t29res.py',desc='resnet') # Need a pointer to the docs showing what is provided # by default additional_definitions = [ {'name':'connections', 'default':1, 'type':int, 'help':'The number of residual connections.'}, {'name':'distance', 'default':1, 'type':int, 'help':'Residual connection distance between dense layers.'} ] t29_common.additional_definitions = additional_definitions gParameters = candle_keras.initialize_parameters(t29_common) return gParameters
def initialize_parameters(): # Add the candle_keras library to the Python path import sys, os sys.path.append(os.getenv("CANDLE") + '/Candle/common') # Instantiate the Benchmark class (the values of the prog and desc parameters don't really matter) import candle_keras as candle mymodel_common = candle.Benchmark(os.path.dirname( os.path.realpath(__file__)), os.getenv("DEFAULT_PARAMS_FILE"), 'keras', prog='myprogram', desc='My CANDLE example') # Read the parameters (in a dictionary format) pointed to by the environment variable DEFAULT_PARAMS_FILE gParameters = candle.initialize_parameters(mymodel_common) # Return this dictionary of parameters return (gParameters)