-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilterNet: Changing the location of nondominant filter also changes the location of dominant filter in class "TwoSubfieldLinearCell" of "cellmodel.py" in bmtk #339
Comments
CloudyDory
changed the title
Changing the location of nondominant filter also changes the location of dominant filter in class "TwoSubfieldLinearCell" of "cellmodel.py" in bmtk
FilterNet: Changing the location of nondominant filter also changes the location of dominant filter in class "TwoSubfieldLinearCell" of "cellmodel.py" in bmtk
Nov 7, 2023
shixnya
added a commit
to shixnya/bmtk
that referenced
this issue
Nov 8, 2023
shixnya
added a commit
to shixnya/bmtk
that referenced
this issue
Nov 8, 2023
Hi CloudyDory, Thank you for the very detailed issue report. I reproduced the bug and we are working towards fixing it. Best, |
shixnya
added a commit
that referenced
this issue
Nov 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
In function
default_cell_loader()
of "bmtk/simulator/filternet/default_setters/cell_loaders.py", variablelinear_filter_son
(line 121) andlinear_filter_soff
(line 124) take the same variablespatial_filter
as input. This causes the two former variables to store the same spatial_filter object.Then,
linear_filter_son
andlinear_filter_soff
are passed into the__init__()
function of "bmtk/simulator/filternet/lgnmodel/cellmodel.py" as argumentdominant_filter
andnondominant_filter
. However, in line 65-69 of this file:the intention is to set a different location for the
nondominant_filter
. But sinceself.dominant_filter.spatial_filter
andself.nondominant_filter.spatial_filter
is actually the same object, changingself.nondominant_filter.spatial_filter.translate
will also changeself.dominant_filter.spatial_filter.translate
.Therefore, when running the LGN filternet, the dominant and nondominant spatial filter will be placed at exactly the same location. This can be verified by checking the
lnunit_cursor_list
inclass SeparableMultiLNUnitCursor
of "bmtk/simulator/filternet/lgnmodel/cursor.py".Steps to reproduce
self.dominant_filter.spatial_filter.translate
, the result should be:(8.07545259102928, 10.021859654121696)
self.dominant_filter.spatial_filter.translate
andself.nondominant_filter.spatial_filter.translate
, the outputs will both be(3.6379139789913113, 6.169332828582764)
. THIS IS THE BUGself.dominant_filter.spatial_filter.translate is self.nondominant_filter.spatial_filter.translate
, the output will beTrue
.self.lnunit_cursor_list[0].spatial_filter.translate, self.lnunit_cursor_list[1].spatial_filter.translate
. The output is((3.6379139789913113, 6.169332828582764), (3.6379139789913113, 6.169332828582764))
.np.abs(self.lnunit_cursor_list[0].spatial_filter.get_kernel(np.arange(120), np.arange(240)).full()).argmax(), np.abs(self.lnunit_cursor_list[1].spatial_filter.get_kernel(np.arange(120), np.arange(240)).full()).argmax()
. The output is(1444, 1444)
, which shows that the two spatial kernels peak at the same location.Suggested fix
Use
copy.deepcopy
to isolate the twospatial_filter
in functiondefault_cell_loader()
of "bmtk/simulator/filternet/default_setters/cell_loaders.py".Attached code
attached_code.zip
The text was updated successfully, but these errors were encountered: