VH-Lab / NDIcalc-vis-matlab

NDI calculator objects and documents for vision research
Other
1 stars 1 forks source link

Responses produced by temporal frequency calculator don't align with the responses specified in the temporal frequency calculator's method generate_mock_docs #23

Closed aviL221 closed 3 months ago

aviL221 commented 3 months ago

I ran the following to plot the responses and the fits (tuning curves) that the temporal frequency calculator generates:

[b,errormsg,b_expected,doc_output,doc_expected_output] = temporal_freq_tuning_calc.test('standard',1,1);

In the plot, there is clearly something funky that happens to increase response to 5(Hz?) when it should be almost 0. In line 373 of ndi.calc.vis.temporal_frequency_tuning/generate_mock_docs, mock docs are generated by the function docs{i} = ndi.mock.fun.stimulus_response(S,param_struct, independent_variable, x, r, noise, reps);. The variable r (the responses created from mock parameters) and docs{1,1}{1,7}.document_properties.stimulus_tuningcurve.response_mean should have essentially the same values, but they diverge especially at index 63: r(63) is close to 0, but docs{1,1}{1,7}.document_properties.stimulus_tuningcurve.response_mean(63) is 5. The next step was to set a breakpoint in ndi.mock.fun.stimulus_response at line 77 and run figure; plot(R,stim_response_doc{1,1}{1,1}.document_properties.stimulus_response_scalar.responses.response_real(1:101),'o') on the command line. This showed that the responses in stim_response_doc had already diverged from the responses specified in generate_mock_docs. The stim_response_doc is created on line 75 by the method stimulus_responses, which takes as input a mock stimulator and mock spikes. This could be where things go wrong. Otherwise, there seems to be an error somewhere in the first 75 lines of the function ndi.mock.fun.stimulus_response. So if you could help identify it that would be amazing!

stevevanhooser commented 3 months ago

Fixed this in NDI-matlab

stevevanhooser commented 3 months ago

You can update to main on NDI-matlab and it will work!