berenslab / RFEst

A Python 3 toolbox for neural receptive field estimation using splines and Gaussian priors.
https://arxiv.org/abs/2108.07537
GNU General Public License v3.0
24 stars 3 forks source link

How to run ASD? #29

Closed michaeldeistler closed 8 months ago

michaeldeistler commented 8 months ago

Hi there! Thanks a lot for building and maintaining this package!

I am trying to run ASD. I have an image stimulus of shape (T, X, Y) and a response of shape (T) with T being the number of time steps. I tried to run ASD with this but I am struggling (the code gives an error):

from rfest import ASD

X = np.zeros((10_000, 20, 15))
Y = np.zeros((10_000,))
asd = ASD(X, Y, dims=[10_000, 20, 15])
p0 = [1., 1., 2., 2., 2.]  # sig, rho, 𝛿t, 𝛿y, 𝛿x
asd.fit(p0=p0, num_iters=300)

Reshaping the stimulus into 2D (i.e., X.shape==(10_000, 20*15)) does not work either.

Thanks a lot for your help!

michaeldeistler commented 8 months ago

Alright, I have dug into this a bit and (after identifying a few basic issues with the above code) I think that the issue is in my data (using only 200 features instead of 300 works, so there must be something off, and using 300 random features also works).

michaeldeistler commented 8 months ago

(Hopefully) final update: adding a small amount of noise to my data fixed all issues.