The voltage unit is incorrect (volt instead of millivolt) in calc_eFEL

Hi all,

I submitted an issue months ago but haven’t got any reponse in GitHub. So I post it again here:

The voltage unit is incorrect (volt instead of millivolt) in calc_eFEL · Issue #77 · brian-team/brian2modelfitting

eFEL requires the voltage unit to be millivolt to calculate the features. However, I found in FeatureMetric that the input voltages have volt units though what I specified in TraceFitter have millivolt units. For example, data_exp is passed to output of TraceFitter with millivolt units (from -73.95*mV to 39.69*mV).

But in calc_eFEL, the output_traces have voltage units (from -0.073 to 0.033), making eFEL inable to detect the action potential and return incorrect features.

The reason why millivolts are changed into volts is in the initialization of TraceFitter (see Line 828-829 of fitter.py). self.output is a Quantity with millivolt unit. But when it is changed into numpy.ndarray in Line 829, self.output_ will get a base unit, i.e., volt unit. And self.output_ is passed into the following feature calculation method, i.e., errors = metric.calc(traces, self.output_, self.dt) in Line 850

Image

To solve this bug, I modify the calc_eFEL by multiplying temp_trace[‘V’] by 1000. But I am not sure whether this is the best solution.

Hi @Jasmine9691, sorry about not getting back to you about this earlier, I’ve replied on the GitHub issue: The voltage unit is incorrect (volt instead of millivolt) in calc_eFEL · Issue #77 · brian-team/brian2modelfitting · GitHub (TL/DR: your fix is good, but the unreleased development version in the GitHub repository has already fixed this issue as well)

Have read it. Thanks for your effort!

1 Like