from opal.core.parameter import Parameter from opal.core.measure import Measure # Define Algorithm object. LAS = Algorithm(name='LAS', description='Lattice Siever') # Register executable for LAS. LAS.set_executable_command('python las_run.py') # Register parameter file used by black-box solver to communicate with LAS. #LAS.set_parameter_file('las.param') # Should be chosen automatically and hidden. # Define parameter and register it with algorithm. lim0 = Parameter(kind='integer', default=lim0_def, bound=(lim0_min, lim0_max), name='lim0', description='Factor base bound, side 0') lim1 = Parameter(kind='integer', default=lim1_def, bound=(lim1_min, lim1_max), name='lim1', description='Factor base bound, side 1') lpb0 = Parameter(kind='integer', default=lpb0_def, bound=(lpb0_min, lpb0_max), name='lpb0', description='Large prime bound, side 0') lpb1 = Parameter(kind='integer', default=lpb1_def, bound=(lpb1_min, lpb1_max),
from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.parameter import ParameterConstraint from opal.core.measure import Measure # Define Algorithm object. trunk = Algorithm(name='TRUNK', description='Trust Region for UNConstrained problems') # Register executable command. trunk.set_executable_command('python trunk_run.py') # Register parameters. trunk.add_param(Parameter(name='eta1', kind='real', default=0.25, bound=[0, 1], description='Gradient scaling cut-off')) trunk.add_param(Parameter(name='eta2', kind='real', default=0.75, bound=[0,1], description='Trust-region increase threashold')) trunk.add_param(Parameter(name='gamma1', kind='real', default=0.5, bound=[0,1], description='Trust-region shrink factor')) trunk.add_param(Parameter(name='gamma2', kind='real', default=1.000,
# Description of ABySS. from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.measure import Measure kd = int(raw_input("k-default: ")) kl = int(raw_input("k-lower: ")) ku = int(raw_input("k-upper: ")) # Define Algorithm object. AB = Algorithm(name='AB', description='ABySS') # Register executable command. AB.set_executable_command('python abyss_run.py') # Define parameter and register it with algorithm. #200k-test k = 30; 16, 48 k = Parameter(kind='integer', default=kd, bound=(kl, ku), name='k', description='Step size') AB.add_param(k) # Define relevant measure and register with algorithm. n50 = Measure(kind='integer', name='N50', description='N50 value') AB.add_measure(n50) #error = Measure(kind='real', name='ERROR', description='Error in derivative') #AB.add_measure(error)
from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.measure import Measure # Define new algorithm. DFO = Algorithm(name='DFO', description='Derivative-free Optimization') # Register executable for DFO. DFO.set_executable_command('python dfo_run.py') # Define parameters. nx = Parameter(kind='integer', default=1, name='NX') maxit = Parameter(kind='integer', default=5000, name='MAXIT') maxef = Parameter(kind='integer', default=9500, name='MAXNF') stpcrtr = Parameter(kind='integer', default=2, name='STPCRTR') delmin = Parameter(default=1.0e-4, name='DELMIN',bound=(1.0e-8,1.0e-3)) stpthr = Parameter(default=1.0e-3, name='STPTHR',bound=(0,None)) cnstol = Parameter(default=1.0e-5, name='CNSTOL',bound=(0,0.1)) delta = Parameter(default=1.0e0, name='DELTA',bound=(1.0e-8,None)) pp = Parameter(default=1.0e0, name='PP',bound=(1,None)) scale = Parameter(kind='integer', default=0, name='SCALE') iprint = Parameter(kind='integer', default=1, name='IPRINT') # Register parameters with algorithm. DFO.add_param(nx) DFO.add_param(maxit) DFO.add_param(maxef) DFO.add_param(stpcrtr) DFO.add_param(delmin) DFO.add_param(stpthr) DFO.add_param(cnstol)
# Description of the foward finite-difference "algorithm". from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.measure import Measure # Define Algorithm object. LAS = Algorithm(name='LAS', description='Lattice Siever') # Register executable for LAS. LAS.set_executable_command('python las_run.py') # Register parameter file used by black-box solver to communicate with LAS. #LAS.set_parameter_file('las.param') # Should be chosen automatically and hidden. # Define parameter and register it with algorithm. lim0 = Parameter(kind='integer', default=lim0_def, bound=(lim0_min, lim0_max), name='lim0', description='Factor base bound, rational side') lim1 = Parameter(kind='integer', default=lim1_def, bound=(lim1_min, lim1_max), name='lim1', description='Factor base bound, algebraic side') lpb0 = Parameter(kind='integer', default=lpb0_def, bound=(lpb0_min, lpb0_max), name='lpb0', description='Large prime bound, rational side') lpb1 = Parameter(kind='integer', default=lpb1_def, bound=(lpb1_min, lpb1_max), name='lpb1', description='Large prime bound, algebraic side') mfb0 = Parameter(kind='integer', default=mfb0_def, bound=(mfb0_min, mfb0_max), name='mfb0', description='Cofactorization bound, rational side') mfb1 = Parameter(kind='integer', default=mfb1_def, bound=(mfb1_min, mfb1_max), name='mfb1', description='Cofactorization bound, algebraic side') ncurves0 = Parameter(kind='integer', default=ncurves0_def, bound=(ncurves0_min,ncurves0_max), name='ncurves0', description='Cofactorization curves, side 0') ncurves1 = Parameter(kind='integer', default=ncurves1_def, bound=(ncurves1_min,ncurves1_max), name='ncurves1', description='Cofactorization curves, side 1') I = Parameter(kind='integer', default=I_def, bound=(I_min, I_max), name='I', description='Sieve region size') LAS.add_param(lim0) LAS.add_param(lim1) LAS.add_param(lpb0) LAS.add_param(lpb1) LAS.add_param(mfb0) LAS.add_param(mfb1) LAS.add_param(ncurves0)
# Description of the foward finite-difference "algorithm". from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.measure import Measure # Define Algorithm object. FD = Algorithm(name='FD', description='Forward Finite Differences') # Register executable for FD. FD.set_executable_command('python fd_run.py') # Register parameter file used by black-box solver to communicate with FD. #FD.set_parameter_file('fd.param') # Should be chosen automatically and hidden. # Define parameter and register it with algorithm. h = Parameter(kind='real', default=0.5, bound=(0, None), name='h', description='Step size') FD.add_param(h) # Define relevant measure and register with algorithm. error = Measure(kind='real', name='ERROR', description='Error in derivative') FD.add_measure(error)
# Description of the foward finite-difference "algorithm". from opal.core.algorithm import Algorithm from opal.core.parameter import Parameter from opal.core.measure import Measure # Define Algorithm object. LAS = Algorithm(name='LAS', description='Lattice Siever') # Register executable for LAS. LAS.set_executable_command('python las_run.py') # Register parameter file used by black-box solver to communicate with LAS. #LAS.set_parameter_file('las.param') # Should be chosen automatically and hidden. # Define parameter and register it with algorithm. lim0 = Parameter(kind='integer', default=600000, bound=(30000, 2000000), name='lim0', description='Factor base bound, rational side') lim1 = Parameter(kind='integer', default=600000, bound=(50000, 2000000), name='lim1', description='Factor base bound, algebraic side') lpb0 = Parameter(kind='integer', default=22, bound=(18, 25), name='lpb0', description='Large prime bound, rational side') lpb1 = Parameter(kind='integer', default=22, bound=(18, 25), name='lpb1', description='Large prime bound, algebraic side') mfb0 = Parameter(kind='integer', default=25, bound=(20, 30), name='mfb0', description='Cofactorization bound, rational side') mfb1 = Parameter(kind='integer', default=25, bound=(20, 30), name='mfb1', description='Cofactorization bound, algebraic side') lambda0 = Parameter(kind='real', default=1.1, bound=(0.8, 1.4), name='lambda0', description='Sieve survivor threshold') lambda1 = Parameter(kind='real', default=1.1, bound=(0.8, 1.4), name='lambda1', description='Sieve survivor threshold') ncurves0 = Parameter(kind='integer', default=6, bound=(3,10), name='ncurves0', description='Cofactorization curves, side 0') ncurves1 = Parameter(kind='integer', default=6, bound=(3,10), name='ncurves1', description='Cofactorization curves, side 1') I = Parameter(kind='integer', default=11, bound=(10, 12), name='I', description='Sieve region size') LAS.add_param(lim0) LAS.add_param(lim1) LAS.add_param(lpb0) LAS.add_param(lpb1) LAS.add_param(mfb0)
# Define parameter and register it with algorithm. # ac = Parameter(kind="categorical", default="relu", # name="ac", description='Activation', # neighbors={"relu": ["tanh", "sigmoid"], # "tanh": ["relu", "sigmoid"], # "sigmoid": ["relu", "tavnh"]}) # NN.add_param(ac) # nv = Parameter(kind="categorical", default="True", # name="nv", description="Nesterov", # neighbors={"True": ["False"], # "False": ["True"]}) # NN.add_param(nv) lr = Parameter(kind="real", default=.001, bound=(0., 1.), name="learning_rate", description="Learning rate") NN.add_param(lr) l1 = Parameter(kind="real", default=.0001, bound=(0., 1.), name="reg_l1", description="L1 regularization") NN.add_param(l1) l2 = Parameter(kind="real", default=.0001, bound=(0., 1.), name="reg_l2", description="L2 regularization") NN.add_param(l2)