Exemplo n.º 1
0
 def test_ap_threshold(self):
     from neuronunit.models.reduced import ReducedModel
     from neuronunit.optimization import get_neab
     from neuronunit.tests.waveform import InjectedCurrentAPThresholdTest as T
     from neuronunit.optimization.optimization_management import format_test
     from neuronunit.optimization import data_transport_container
     dtc = data_transport_container.DataTC()
     dtc.rheobase = self.rheobase
     dtc = format_test(dtc)
     self.model = ReducedModel(get_neab.LEMS_MODEL_PATH, backend=('NEURON',{'DTC':dtc}))
     #score = self.run_test(T)
     score = self.run_test(T,pred=self.rheobase)
Exemplo n.º 2
0
 def test_ap_threshold(self):
     from neuronunit.models.reduced import ReducedModel
     from neuronunit.optimization import get_neab
     from neuronunit.tests.waveform import InjectedCurrentAPThresholdTest as T
     from neuronunit.optimization.optimization_management import format_test
     from neuronunit.optimization import data_transport_container
     dtc = data_transport_container.DataTC()
     dtc.rheobase = self.rheobase
     dtc = format_test(dtc)
     self.model = ReducedModel(get_neab.LEMS_MODEL_PATH, backend=('NEURON',{'DTC':dtc}))
     #score = self.run_test(T)
     score = self.run_test(T,pred=self.rheobase)
     assert score.sort_key is not None
     self.assertTrue(score.sort_key is not None)
Exemplo n.º 3
0
    assert seeds is not None

except:

    for local_attrs in grid:
        store_glif_results[str(local_attrs.values())] = {}
        dtc = DataTC()
        dtc.tests = use_test
        complete_params = {}
        dtc.attrs = local_attrs
        dtc.backend = 'GLIF'
        dtc.cell_name = 'GLIF'
        for key, use_test in test_frame.items():
            dtc.tests = use_test
            dtc = dtc_to_rheo(dtc)
            dtc = format_test(dtc)
            if dtc.rheobase is not None:
                if dtc.rheobase!=-1.0:
                    dtc = nunit_evaluation(dtc)
            print(dtc.get_ss())
            store_glif_results[str(local_attrs.values())][key] = dtc.get_ss()
        df = pd.DataFrame(store_glif_results)
        best_params = {}
        for index, row in df.iterrows():
            best_params[index] = row == row.min()
            best_params[index] = best_params[index].to_dict()


        seeds = {}
        for k,v in best_params.items():
            for nested_key,nested_val in v.items():