def guiRun_network(): nd = Net_data( model_path=tbx_model_path.value, raw_data_path=tbx_raw_data_path.value, dropout=float(tbx_dropout.value), filtered_data_path=tbx_filtered_data_path.value, stride=int(tbx_stride.value), epochs=int(tbx_epochs.value), from_raw_data=bool(cbo_from_raw_data.value == "True"), evaluate_training=bool(cbo_evaluate_training.value == "True"), session_filter=Filter(func=hann, search_radius=int(tbx_search_radius.value), step_size=int(tbx_step_size.value)), time_shift_steps=int(tbx_time_shift_steps.value), shuffle_data=bool(cbo_shuffle_data.value == "True"), shuffle_factor=int(tbx_shuffle_factor.value), time_shift_iter=int(tbx_time_shift_iter.value), initial_timeshift=int(tbx_initial_timeshift.value), metric_iter=int(tbx_metric_iter.value), batch_size=int(tbx_batch_size.value), slice_size=int(tbx_slice_size.value), x_max=int(tbx_x_max.value), y_max=int(tbx_y_max.value), x_min=int(tbx_x_min.value), y_min=int(tbx_y_min.value), x_step=int(tbx_x_step.value), y_step=int(tbx_y_step.value), early_stopping=bool(cbo_early_stopping.value == "True"), naive_test=bool(cbo_naive_test.value == "True"), valid_ratio=float(tbx_valid_ratio.value), testing_ratio=float(tbx_testing_ratio.value), k_cross_validation=int(tbx_k_cross_validation.value), load_model=bool(cbo_load_model.value == "True"), train_model=bool(cbo_train_model.value == "True"), keep_neurons=-1, neurons_kept_factor=float(tbx_neurons_kept_factor.value), lw_classifications=None if not tbx_lw_classifications.value.isnumeric() else int( tbx_lw_classifications.value), lw_normalize=bool(cboLw_normalize.value == "True"), lw_differentiate_false_licks=bool( cbo_lw_differentiate_false_licks.value == "True"), num_wells=int(tbx_num_wells.value), metric=tbx_metric.value, valid_licks=None if tbx_valid_licks.value == 'None' else tbx_valid_licks.value, filter_tetrodes=None if tbx_filter_tetrodes.value == 'None' else tbx_filter_tetrodes.value, phases=None if tbx_phases.value == 'None' else tbx_phases.value, phase_change_ids=None if tbx_phase_change_ids.value == 'None' else tbx_phase_change_ids.value, number_of_bins=int(tbx_number_of_bins.value), start_time_by_lick_id=None if not tbx_start_time_by_lick_id.value.isnumeric() else int( tbx_start_time_by_lick_id.value), behavior_component_filter=None if cbo_behavior_component.value == 'None' else cbo_behavior_component.value) if tbx_metric.value == "map": session = initiate_network(nd) run_network(nd, session) else: session = initiate_lickwell_network(nd) # Initialize session X, y, nd, session, = lickwells_io(session, nd, _excluded_wells=[1], shift=nd.initial_timeshift, target_is_phase=False, lickstart=0, lickstop=5000) pass
model_path=MODEL_PATH, raw_data_path=RAW_DATA_PATH, filtered_data_path=FILTERED_DATA_PATH, k_cross_validation=1, valid_ratio=0.1, naive_test=True, from_raw_data=True, epochs=30, dropout=0.65, behavior_component_filter=None, filter_tetrodes=filter_tetrodes, shuffle_data=True, shuffle_factor=10, batch_size=50, switch_x_y=combination_data_set) session = initiate_network(nd) run_network(nd, session) nd = Net_data(initial_timeshift=-2500, time_shift_iter=-500, time_shift_steps=20, early_stopping=False, model_path=MODEL_PATH, raw_data_path=RAW_DATA_PATH, filtered_data_path=FILTERED_DATA_PATH, k_cross_validation=1, valid_ratio=0.1, naive_test=True, from_raw_data=False, epochs=30, dropout=0.65,
def filter_well(x,y,well): if __name__ == '__main__': # prefrontal cortex # MODEL_PATH = "G:/master_datafiles/trained_networks/MLP_PFC_2018-11-06_1000_200_100_dmf/" # RAW_DATA_PATH = "G:/master_datafiles/raw_data/2018-04-09_14-39-52/" # FILTERED_DATA_PATH = "G:/master_datafiles/filtered_data/neocortex_hann_win_size_20.pkl" # hippocampus MODEL_PATH = "G:/master_datafiles/trained_networks/MLP_HC_2018-11-11_1000_200_100_dmf/" RAW_DATA_PATH = "G:/master_datafiles/raw_data/2018-05-16_17-13-37/" FILTERED_DATA_PATH = "G:/master_datafiles/filtered_data/hippocampus_hann_win_size_25_09-5_7.pkl" NEURONS_KEPT_FACTOR = 1 WIN_SIZE = 20 SEARCH_RADIUS = WIN_SIZE * 2 session_filter = Filter(func=hann, search_radius=SEARCH_RADIUS, step_size=WIN_SIZE) nd = Net_data( # Program execution settings EPOCHS=20, SEARCH_RADIUS=SEARCH_RADIUS, WIN_SIZE=WIN_SIZE, INITIAL_TIMESHIFT=0, TIME_SHIFT_ITER=200, TIME_SHIFT_STEPS=1, METRIC_ITER=1, # after how many epochs network is validated <--- SHUFFLE_DATA=True, # whether to randomly shuffle the data in big slices SHUFFLE_FACTOR=500, EARLY_STOPPING=True, NAIVE_TEST=False, K_CROSS_VALIDATION=1, TRAIN_MODEL=True, # Input data parameters SLICE_SIZE=1000, Y_SLICE_SIZE=200, STRIDE=100, BATCH_SIZE=50, VALID_RATIO=0.1, X_MAX=240, Y_MAX=190, X_MIN=0, Y_MIN=100, X_STEP=3, y_step=3, LOAD_MODEL= False, session_filter=session_filter, MODEL_PATH=MODEL_PATH, r2_scores_train=[], r2_scores_valid=[], acc_scores_train=[], acc_scores_valid=[], avg_scores_train=[], avg_scores_valid=[], RAW_DATA_PATH=RAW_DATA_PATH, ) X,y,session = initiate_network(nd) run_network(X,y,nd,session)