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
@@ -180,7 +175,7 @@ Now that we have HD tuning curves, we can go one step further. Using only the po
180
175
We will then compare this to the real head-direction of the animal, and discover that population activity in the ADn indeed codes for HD.
181
176
182
177
To decode the population activity, we will be using a bayesian decoder as implemented in Pynapple.
183
-
Again, just a single line of code!
178
+
Again, just a single line of code:
184
179
185
180
```{code-cell} ipython3
186
181
decoded, proba_feature = nap.decode_bayes(
@@ -197,7 +192,7 @@ What does this look like?
197
192
print(decoded)
198
193
```
199
194
200
-
The variable 'decoded' contains the most probable angle, and 'proba_feature' contains the probability of a given angular bin at a given time point:
195
+
The variable ``decoded`` contains the most probable angle, and ``proba_feature`` contains the probability of a given angular bin at a given time point:
201
196
202
197
```{code-cell} ipython3
203
198
print(proba_feature)
@@ -227,15 +222,15 @@ plt.ylabel("Neurons")
227
222
plt.show()
228
223
```
229
224
230
-
From this plot, we can see that the decoder is able to estimate the head-direction based on the population activity in ADn. Amazing!
225
+
From this plot, we can see that the decoder is able to estimate the head-direction based on the population activity in ADn.
231
226
232
-
What does the probability distribution in this example event look like?
233
-
Ideally, the bins with the highest probability will correspond to the bins having the most spikes. Let's plot the probability matrix to visualize this.
227
+
We can also visualize the probability distribution.
228
+
Ideally, the bins with the highest probability correspond to the bins with the most spikes.
234
229
235
230
```{code-cell} ipython3
236
231
smoothed = scipy.ndimage.gaussian_filter(
237
232
proba_feature, 1
238
-
) # Smoothening the probability distribution
233
+
) # Smoothing the probability distribution
239
234
240
235
# Create a DataFrame with the smoothed distribution
241
236
p_feature = pd.DataFrame(
@@ -270,8 +265,7 @@ plt.show()
270
265
```
271
266
272
267
<!-- #region -->
273
-
From this probability distribution, we observe that the decoded HD closely matches the actual HD.
274
-
Hence, the population activity in ADn is a reliable estimate of the heading direction of the animal.
268
+
The decoded HD (dashed grey line) closely matches the actual HD (solid white line), and thus the population activity in ADn is a reliable estimate of the heading direction of the animal.
275
269
276
270
I hope this tutorial was helpful. If you have any questions, comments or suggestions, please feel free to reach out to the Pynapple Team!
0 commit comments