def model_complexity_exp_alpha1(self): #TODO should we create a new learner object?? self.learner = ANNLearner(hidden_layer_sizes=(300, )) self.expHelper = ExperimentHelper(self.splitter, self.learner, '1') #param_range = np.array([(100),(200,),(300,),(400,),(500,)]) #param_range = np.array([0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) param_range = np.array([0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) self.expHelper.model_complexity_exp('alpha', param_range) self.learner = ANNLearner(hidden_layer_sizes=(390, )) self.expHelper = ExperimentHelper(self.splitter, self.learner, '2') #param_range = np.array([(100),(200,),(300,),(400,),(500,)]) param_range = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7]) #param_range = np.array([0.0001, 0.0005, 0.001, 0.005, 0.008]) self.expHelper.model_complexity_exp('alpha', param_range)
def model_complexity_exp11(self): #TODO should we create a new learner object?? self.learner = ANNLearner() self.expHelper = ExperimentHelper(self.splitter, self.learner) param_range = np.array([(50, ), ( 50, 50, ), ( 50, 50, 50, ), ( 50, 50, 50, 50, ), ( 50, 50, 50, 50, 50, )]) #param_range = np.array([100, 200,300,400, 500]) self.expHelper.model_complexity_exp('hidden_layer_sizes', param_range)
def model_complexity_exp_alpha2(self): #TODO should we create a new learner object?? self.learner = ANNLearner() self.expHelper = ExperimentHelper(self.splitter, self.learner, '2') #param_range = np.array([(100),(200,),(300,),(400,),(500,)]) param_range = np.array([0.0001, 0.001, 0.01, 0.1, 1, 5]) self.expHelper.model_complexity_exp('alpha', param_range)
def experiment_run_test_bank2(self): self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(390, ), learning_rate='constant', solver='adam', early_stopping=False) self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test()
def learning_curve_iter21_bank(self): self.learner = ANNLearner(activation='relu', alpha=0.01, hidden_layer_sizes=(300, ), learning_rate='constant', solver='adam', early_stopping=False) self.expHelper = ExperimentHelper(self.splitter, self.learner, '-iter-2') self.expHelper.learning_curve_exp()
def model_complexity_exp_epoch2(self): #TODO should we create a new learner object?? self.learner = ANNLearner(hidden_layer_sizes=(300, ), alpha=0.0001, early_stopping=False) self.expHelper = ExperimentHelper(self.splitter, self.learner, '3') #param_range = np.array([(100),(200,),(300,),(400,),(500,)]) #param_range = np.array([0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) param_range = np.array([1, 10, 50, 100, 200, 500, 1000]) self.expHelper.model_complexity_exp('max_iter', param_range)
def experiment_run_test_bank_iter2(self): self.learner = ANNLearner(activation='relu', alpha=0.06, hidden_layer_sizes=(200, 200, 200, 200, 200, 200, 200), learning_rate='constant', solver='adam', early_stopping=True, max_iter=600, momentum=0.4) print('100, 100, 100, 100, 100, 100,50 alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() """ self.learner = ANNLearner(
def model_complexity_exp_epoch(self): #TODO should we create a new learner object?? self.learner = ANNLearner(activation='relu', alpha=0.01, hidden_layer_sizes=( 50, 50, 50, ), learning_rate='constant', solver='adam', early_stopping=True) self.expHelper = ExperimentHelper(self.splitter, self.learner, '2') #param_range = np.array([(100),(200,),(300,),(400,),(500,)]) #param_range = np.array([0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) param_range = np.array([1, 10, 50, 100, 200, 500]) self.expHelper.model_complexity_exp('max_iter', param_range)
def __init__(self, reader, helper, splitter): self.reader = reader self.helper = helper self.learner = ANNLearner() self.splitter = splitter self.expHelper = ExperimentHelper(self.splitter, self.learner)
def experiment_run_test_bank_iter(self): self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(390, 100), learning_rate='constant', solver='adam', early_stopping=False) print('390,100') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(200, 200, 200), learning_rate='constant', solver='adam', early_stopping=False) print('200, 200, 200') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(400, 400, 400), learning_rate='constant', solver='adam', early_stopping=False) print('400, 400, 400') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(500, 500, 500), learning_rate='constant', solver='adam', early_stopping=False) print('500, 500, 500') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(200, 300, 400), learning_rate='constant', solver='adam', early_stopping=False) print('200, 300, 400') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.7, hidden_layer_sizes=(390, 100), learning_rate='constant', solver='adam', early_stopping=False) print('390,100') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(200, 200, 200), learning_rate='constant', solver='adam', early_stopping=False) print('200, 200, 200 alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(400, 400, 400), learning_rate='constant', solver='adam', early_stopping=False) print('400, 400, 400 alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(500, 500, 500), learning_rate='constant', solver='adam', early_stopping=False) print('500, 500, 500 alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(200, 300, 400), learning_rate='constant', solver='adam', early_stopping=False) print('200, 300, 400 alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=( 100, 100, 100, 100, ), learning_rate='constant', solver='adam', early_stopping=False) print('100, 100, 100, 100, alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(100, 100, 100, 100, 100), learning_rate='constant', solver='adam', early_stopping=False) print('100, 100, 100, 100, 100, alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(100, 100, 100, 100, 100, 50), learning_rate='constant', solver='adam', early_stopping=False) print('100, 100, 100, 100, 100, 50, alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test() self.learner = ANNLearner(activation='relu', alpha=0.3, hidden_layer_sizes=(50, 50, 50, 50, 50, 50), learning_rate='constant', solver='adam', early_stopping=False) print('50, 50, 50, 50, 50, 50, alpha 0.3') self.expHelper = ExperimentHelper(self.splitter, self.learner) self.expHelper.experiment_run_test()