def setup_functions(self): self.dict[ constants. DNA_SIZE_STR] = lambda list_input: ng.generate_gaussian_integers( list_input[0], list_input[1], list_input[2], list_input[3], list_input[4]) self.dict[ constants. DNA_ACTIONS_STR] = lambda list_input: ng.generate_n_uniform_random_integers( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_FEATURES_STR] = lambda list_input: ng.generate_n_uniform_random_integers( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_WEIGHTS_STR] = lambda list_input: ng.generate_n_uniform_random_values( list_input[0]) self.dict[ constants. DNA_PARENTHESES_STR] = lambda list_input: ng.generate_n_uniform_random_integers( list_input[0], list_input[1], list_input[2]) self.dict[ constants.DNA_WL_SCALAR] = lambda list_input: ng.generate_gaussian( list_input[0], list_input[1], list_input[2]) self.dict[ constants.DNA_WL_POWER] = lambda list_input: ng.generate_gaussian( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_PARENTHESES_BIAS] = lambda list_input: ng.generate_gaussian( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_WL_ACTIVATION] = lambda list_input: ng.generate_non_uniform_integers( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_PARENTHESES_ACTIVATION] = lambda list_input: ng.generate_non_uniform_integers( list_input[0], list_input[1], list_input[2]) self.dict[ constants.DNA_WL_BIAS] = lambda list_input: ng.generate_gaussian( list_input[0], list_input[1], list_input[2]) self.dict[ constants. DNA_PARENTHESES_POWER] = lambda list_input: ng.generate_gaussian( list_input[0], list_input[1], list_input[2])
def sample_parentheses_bias(mu, sigma): return ng.generate_gaussian(mu=mu, sigma=sigma, size=1)[0]
def create_parentheses_bias_vector(mu, sigma, size): return ng.generate_gaussian(mu=mu, sigma=sigma, size=size)
def sample_wl_powers(mu, sigma): return ng.generate_gaussian(mu=mu, sigma=sigma, size=1)[0]
def create_wl_powers_vector(mu, sigma, size): return ng.generate_gaussian(mu=mu, sigma=sigma, size=size)
def test_generate_gaussian(mu, sigma, size): result = ng.generate_gaussian(mu=mu, sigma=sigma, size=size) assert (len(result) == size)