Skip to content

Commit c4db912

Browse files
committed
fast / slow with top/bottom 20%
1 parent 4cdef05 commit c4db912

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

batch_analysis.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def analyze(identifier):
1515
pickles_root_path=pickles_path)
1616

1717
pf = PlaceFields.current_instance(config)
18-
# pf.plot_activations(fig_size=(4, 4))
18+
pf.plot_activations(fig_size=(4, 4))
1919
pf.sizes_vs_mean_speed(plot=True)
2020
pf.slow_and_fast_sizes()
21-
# pf.density_vs_mean_speed()
22-
# pf.field_peak_shifts(plot=True) # only for NetworkIntDriven and NetworkExtDriven
21+
pf.density_vs_mean_speed()
22+
pf.field_peak_shifts(plot=True) # only for NetworkIntDriven and NetworkExtDriven
2323
# pf.size_vs_induction_speed() # only for NetworkIndep
2424
del pf
2525

@@ -28,10 +28,10 @@ def analyze(identifier):
2828
pp.fast_and_slow_slopes()
2929
del pp
3030

31-
# sweeps = ThetaSweeps.current_instance(config)
32-
# sweeps.length_vs_mean_speed(plot=True)
33-
# sweeps.ahead_and_behind_vs_mean_speed(plot=True)
34-
# sweeps.behind_length_vs_peak_shift(plot=True) # only for NetworkIntDriven and NetworkExtDriven
31+
sweeps = ThetaSweeps.current_instance(config)
32+
sweeps.length_vs_mean_speed(plot=True)
33+
sweeps.ahead_and_behind_vs_mean_speed(plot=True)
34+
sweeps.behind_length_vs_peak_shift(plot=True) # only for NetworkIntDriven and NetworkExtDriven
3535

3636

3737
# RUN ANALYSES

batch_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# choose network class in NetworkClass.py
99

1010
variants = {'NetworkIntDriven': 'IntDrivenLog80', 'NetworkExtDriven': 'ExtDrivenLog100', 'NetworkIndep': 'IndepLog80'}
11-
variants |= {'LinearTrack': 'ManyLaps'} # for fast / slow analysis with top and bottom 20% percentiles of speed
11+
variants |= {'LinearTrack': 'ManyLaps'} # better for fast/slow analysis with top and bottom 20% percentiles of speed
1212
# variants |= {'PlaceFields': 'HighThreshold'} # comment this out only when using NetworkIndep
1313

1414

batch_plots.py

+20-18
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def plot_speed_ratios(name, class_def: Type[SmartSim], x_label, rel_path_y, bin_
151151
ax.set_ylabel("Count")
152152
ax.set_xlabel(x_label)
153153

154+
ax.set_xlim((0.65, 1.35))
155+
154156
ax.xaxis.set_major_locator(ticker.MultipleLocator(0.2))
155157

156158
ax.spines.right.set_visible(False)
@@ -170,29 +172,29 @@ def plot_speed_ratios(name, class_def: Type[SmartSim], x_label, rel_path_y, bin_
170172
z_binned_average=True, z_bin_size=2, fig_size=(4.94*CM, 5*CM))
171173
plot_speed_ratios("size_increments", PlaceFields, "Fast / slow", "slow_and_fast_sizes",
172174
bin_size=0.05, fig_size=(3.75*CM, 2.3*CM))
173-
# plot("densities", PlaceFields, x_label, "density/speeds", "Place field density (peaks/cm)", "density/densities",
174-
# alpha=0.5, x_binned_average=True, x_bin_size=2, fig_size=(3.73*CM, 4.9*CM))
175+
plot("densities", PlaceFields, x_label, "density/speeds", "Place field density (peaks/cm)", "density/densities",
176+
alpha=0.5, x_binned_average=True, x_bin_size=2, fig_size=(3.73*CM, 4.9*CM))
175177

176178
plot("slopes", PhasePrecession, x_label, "speeds", "1 / phase precession slope (cm/deg)", "slopes",
177179
"Position (cm)", "positions", z_binned_average=True, z_bin_size=2, fig_size=(5.25*CM, 5*CM), multiple_locator=0.05)
178180
plot_speed_ratios("slope_increments", PhasePrecession, "Fast / slow", "slow_and_fast_slopes", fig_size=(3.75*CM, 2.3*CM))
179181

180-
# plot("sweep lengths", ThetaSweeps, x_label, "speeds", "Theta sweep length (cm)", "lengths", "Position (cm)", "positions",
181-
# z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
182-
# plot("ahead lengths", ThetaSweeps, x_label, "ahead_and_behind/ahead_speeds", "Look-ahead distance (cm)",
183-
# "ahead_and_behind/ahead_lengths", "Position (cm)", "ahead_and_behind/ahead_real_pos",
184-
# z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
185-
# plot("behind lengths", ThetaSweeps, x_label, "ahead_and_behind/behind_speeds", "Look-behind distance (cm)",
186-
# "ahead_and_behind/behind_lengths", "Position (cm)", "ahead_and_behind/behind_real_pos",
187-
# z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
188-
#
189-
# # only for NetworkIntDriven and NetworkExtDriven:
190-
# plot("shifts", PlaceFields, x_label, "shifts/speeds", "Place field shift (cm)", "shifts/shifts", "Position (cm)",
191-
# "shifts/positions", z_binned_average=True, z_bin_size=2, fig_size=small_fig)
192-
# plot("matched shifts", ThetaSweeps, "Place field shift (cm)", "ahead_and_behind/shifts",
193-
# "Look-behind distance (cm)", "ahead_and_behind/behind_lengths", "Position (cm)",
194-
# "ahead_and_behind/behind_real_pos", z_binned_average=True, z_bin_size=2, s=5, format='png',
195-
# extra_plotting=lambda ax: ax.plot((0, 20), (0, 20), linestyle='dashed', color='black'), fig_size=small_fig)
182+
plot("sweep lengths", ThetaSweeps, x_label, "speeds", "Theta sweep length (cm)", "lengths", "Position (cm)", "positions",
183+
z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
184+
plot("ahead lengths", ThetaSweeps, x_label, "ahead_and_behind/ahead_speeds", "Look-ahead distance (cm)",
185+
"ahead_and_behind/ahead_lengths", "Position (cm)", "ahead_and_behind/ahead_real_pos",
186+
z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
187+
plot("behind lengths", ThetaSweeps, x_label, "ahead_and_behind/behind_speeds", "Look-behind distance (cm)",
188+
"ahead_and_behind/behind_lengths", "Position (cm)", "ahead_and_behind/behind_real_pos",
189+
z_binned_average=True, z_bin_size=2, s=5, format='png', fig_size=small_fig)
190+
191+
# only for NetworkIntDriven and NetworkExtDriven:
192+
plot("shifts", PlaceFields, x_label, "shifts/speeds", "Place field shift (cm)", "shifts/shifts", "Position (cm)",
193+
"shifts/positions", z_binned_average=True, z_bin_size=2, fig_size=small_fig)
194+
plot("matched shifts", ThetaSweeps, "Place field shift (cm)", "ahead_and_behind/shifts",
195+
"Look-behind distance (cm)", "ahead_and_behind/behind_lengths", "Position (cm)",
196+
"ahead_and_behind/behind_real_pos", z_binned_average=True, z_bin_size=2, s=5, format='png',
197+
extra_plotting=lambda ax: ax.plot((0, 20), (0, 20), linestyle='dashed', color='black'), fig_size=small_fig)
196198

197199
# # only for NetworkIndep:
198200
# plot("sizes_vs_induction_speed", PlaceFields, "Induction speed (cm/s)", "induction_speeds/induction_speeds",

parameters/PlaceFields.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"last_unit": 170,
88
"dens_window_size": 10,
99
"dens_window_stride": 2,
10-
"speed_percentile": 25
10+
"speed_percentile": 20
1111
}

0 commit comments

Comments
 (0)