def make_left_contrast_higher_neuron(trial_features, number_of_time_bins): number_of_trials = trial_features.shape[1] earliest_response = trial_features[-1].min() * 100 # setting a reasonable range for peak forward_time_shift_relative_to_response = np.random.uniform( 2, earliest_response - 5) sigma = np.random.uniform(0, number_of_time_bins / 4) if trial_features[3][0] == 1: # stimulus was higher left contrast mu = trial_features[-1][ 0] * 100 - forward_time_shift_relative_to_response firings_on_trial = math_utility.my_gaussian( np.arange(number_of_time_bins), mu, sigma) else: firings_on_trial = np.zeros(number_of_time_bins) for trial in range(number_of_trials - 1): if trial_features[3][trial + 1] == 1: # stimulus was higher left contrast mu = trial_features[-1][ trial + 1] * 100 - forward_time_shift_relative_to_response next_firings = math_utility.my_gaussian( np.arange(number_of_time_bins), mu, sigma) else: next_firings = np.zeros(number_of_time_bins) firings_on_trial = np.vstack((firings_on_trial, next_firings)) return firings_on_trial
def make_response_neuron(trial_features, number_of_time_bins): number_of_trials = trial_features.shape[1] earliest_response = trial_features[-1].min() * 100 # setting a reasonable range for peak forward_time_shift_relative_to_response = np.random.uniform( 2, earliest_response - 5) sigma = np.random.uniform(0, number_of_time_bins / 4) mu = trial_features[-1][0] * 100 - forward_time_shift_relative_to_response firings_on_trial = math_utility.my_gaussian(np.arange(number_of_time_bins), mu, sigma) for trial in range(number_of_trials - 1): mu = trial_features[-1][ trial + 1] * 100 - forward_time_shift_relative_to_response next_firings = math_utility.my_gaussian(np.arange(number_of_time_bins), mu, sigma) firings_on_trial = np.vstack((firings_on_trial, next_firings)) return firings_on_trial