You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the BVC firingrates weren't scaling correctly if max_fr is not 1. I've traced the source of the issue to self.cell_fr_norm. This value is initialized based on scaled firingrates, but then applied before scaling when calling get_state(), and thus cancels out the subsequent scaling. See L1543 and L1679 of Neurons.py
import numpy as np
from ratinabox import Agent, Environment
from ratinabox.Neurons import BoundaryVectorCells
MAX_FR = 1
np.random.seed(10)
env = Environment()
ag = Agent(env)
BVCs = BoundaryVectorCells(ag, params={"min_fr": 0, "max_fr": MAX_FR})
for i in range (500):
ag.update()
BVCs.update()
min = np.asarray(BVCs.history["firingrate"]).min()
max = np.asarray(BVCs.history["firingrate"]).max()
print(f"{min:.4f} to {max:.4f}")
gives 0.0000 to 1.0165 (FYI: you can see there's a slight overshoot of the max, which might be for another issue.)
But, if you set MAX_FR = 10, you still get 0.0000 to 1.0165.
I'll create a PR in a moment to propose a solution.
The text was updated successfully, but these errors were encountered:
Oh yes I see that is a bit of a bug, it totally cancels itself out. Not sure how I'd missed that/when it crept in. I'll take a look at your PR and leave this open until it's solved
I noticed that the BVC firingrates weren't scaling correctly if
max_fr
is not 1. I've traced the source of the issue toself.cell_fr_norm
. This value is initialized based on scaled firingrates, but then applied before scaling when callingget_state()
, and thus cancels out the subsequent scaling. See L1543 and L1679 ofNeurons.py
gives
0.0000 to 1.0165
(FYI: you can see there's a slight overshoot of the max, which might be for another issue.)But, if you set
MAX_FR = 10
, you still get0.0000 to 1.0165
.I'll create a PR in a moment to propose a solution.
The text was updated successfully, but these errors were encountered: