Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/extra_models_examples/stdp_triplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,19 @@ def generate_fixed_frequency_test_data(
size="xx-large")

line_styles = ["--", "-"]
for m_w, d_w, d_e, line_style, t in zip(
for m_w, d_w, d_e, line_style, ms in zip(
weights, data_w, data_e, line_styles, delta_t):
# Calculate deltas from end weights
delta_w = [(w - start_w) / start_w for w in m_w]

# Plot experimental data and error bars
axis.errorbar(
frequencies, d_w, yerr=d_e, color="black", linestyle=line_style,
label=r"Experimental data, delta $(\Delta{t}=%dms)$" % t)
label=rf"Experimental data, delta $(\Delta{t}={ms}ms)$")

# Plot model data
axis.plot(frequencies, delta_w, color="blue", linestyle=line_style,
label=r"Triplet rule, delta $(\Delta{t}=%dms)$" % t)
label=rf"Triplet rule, delta $(\Delta{t}={ms}ms)$")

axis.legend(loc="upper right", bbox_to_anchor=(1.0, 1.0))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def plot_spikes(spikes, title, n_neurons):
pylab.plot(punishments, [0.5 for x in punishments], 'r^')
pylab.show()

print("Weights(Initial %s)" % plastic_weights)
print(f"Weights(Initial {plastic_weights})")
for x in weights:
print(x)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def plot_spikes(spikes, title, n_pops, n_neurons):
pylab.plot(punishments, [0.5 for x in punishments], 'r^')
pylab.show()

print("Weights(Initial %s)" % plastic_weights)
print(f"Weights(Initial {plastic_weights})")
for x in weights:
print(x)

Expand Down
36 changes: 18 additions & 18 deletions examples/split_examples/va_benchmark_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
# === Build the network ===

extra = {'threads': threads,
'filename': "va_%s.xml" % benchmark,
'filename': f"va_{benchmark}.xml",
'label': 'VA'}
if simulator_name == "neuroml":
extra["file"] = "VAbenchmarks.xml"
Expand All @@ -129,10 +129,10 @@
np = 1

host_name = socket.gethostname()
print("Host #%d is on %s" % (np, host_name))
print(f"Host #{np} is on {host_name}")

print("%s Initialising the simulator with %d thread(s)..." % (
node_id, extra['threads']))
print(f"{node_id} Initialising the simulator with "
f"{extra['threads']} thread(s)...")

cell_params = {'tau_m': tau_m,
'tau_syn_E': tau_exc,
Expand All @@ -153,7 +153,7 @@

timer.start()

print("%s Creating cell populations..." % node_id)
print(f"{node_id} Creating cell populations...")
exc_cells = p.Population(
n_exc, celltype(**cell_params), label="Excitatory_Cells", seed=1)
inh_cells = p.Population(
Expand All @@ -168,12 +168,12 @@
ext_conn = p.FixedProbabilityConnector(rconn)
ext_stim.record("spikes")

print("%s Initialising membrane potential to random values..." % node_id)
print(f"{node_id} Initialising membrane potential to random values...")
uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh])
exc_cells.initialize(v=uniformDistr)
inh_cells.initialize(v=uniformDistr)

print("%s Connecting populations..." % node_id)
print(f"{node_id} Connecting populations...")
exc_conn = p.FixedProbabilityConnector(pconn)
inh_conn = p.FixedProbabilityConnector(pconn)

Expand All @@ -200,13 +200,13 @@
synapse_type=p.StaticSynapse(weight=0.1))

# === Setup recording ===
print("%s Setting up recording..." % node_id)
print(f"{node_id} Setting up recording...")
exc_cells.record("spikes")

buildCPUTime = timer.diff()

# === Run simulation ===
print("%d Running simulation..." % node_id)
print(f"{node_id} Running simulation...")

print(f"timings: number of neurons: {n}")
print(f"timings: number of synapses: {n * n * pconn}")
Expand All @@ -232,15 +232,15 @@

if node_id == 0:
print("\n--- Vogels-Abbott Network Simulation ---")
print("Nodes : %d" % np)
print("Simulation type : %s" % benchmark)
print("Number of Neurons : %d" % n)
print("Number of Synapses : %s" % connections)
print("Excitatory conductance : %g nS" % Gexc)
print("Inhibitory conductance : %g nS" % Ginh)
print("Build time : %g s" % buildCPUTime)
print("Simulation time : %g s" % simCPUTime)
print("Writing time : %g s" % writeCPUTime)
print(f"Nodes : {np}")
print(f"Simulation type : {benchmark}")
print(f"Number of Neurons : {n}")
print(f"Number of Synapses : {connections}")
print(f"Excitatory conductance : {Gexc} nS")
print(f"Inhibitory conductance : {Ginh} nS")
print(f"Build time : {buildCPUTime} s")
print(f"Simulation time : {simCPUTime} s")
print(f"Writing time : {writeCPUTime} s")


# === Finished with simulator ===
Expand Down
Loading