Skip to content

Commit

Permalink
Fix timing in early-stopping
Browse files Browse the repository at this point in the history
Co-authored-by: JesusEV <43375826+JesusEV@users.noreply.github.com>
  • Loading branch information
akorgor and JesusEV committed Oct 26, 2024
1 parent 2328f7f commit a934210
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,13 @@ def run_phase(self, phase_label, eta):
nest.SetStatus(gen_rate_target, params_gen_rate_target)
nest.SetStatus(gen_learning_window, params_gen_learning_window)

self.simulate("total_offset")
self.simulate("extension_sim")

if self.n_iter_sim > 0:
self.evaluate()

duration["sim"] = group_size * duration["sequence"] - duration["extension_sim"]
duration["sim"] = group_size * duration["sequence"] - duration["total_offset"] - duration["extension_sim"]

self.simulate("sim")

Expand Down Expand Up @@ -693,8 +694,6 @@ def simulate(self, k):
nest.Simulate(duration[k])

def run(self):
self.simulate("total_offset")

while self.k_iter < n_iter_train and not self.early_stop:
self.run_validation()
self.run_early_stopping()
Expand All @@ -703,6 +702,7 @@ def run(self):

self.run_test()

self.simulate("total_offset")
self.simulate("extension_sim")

self.evaluate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,13 @@ def run_phase(self, phase_label, eta):
nest.SetStatus(gen_spk_in, params_gen_spk_in)
nest.SetStatus(gen_rate_target, params_gen_rate_target)

self.simulate("total_offset")
self.simulate("extension_sim")

if self.n_iter_sim > 0:
self.evaluate()

duration["sim"] = batch_size * duration["sequence"] - duration["extension_sim"]
duration["sim"] = batch_size * duration["sequence"] - duration["total_offset"] - duration["extension_sim"]

self.simulate("sim")

Expand Down Expand Up @@ -680,8 +681,6 @@ def simulate(self, k):
nest.Simulate(duration[k])

def run(self):
self.simulate("total_offset")

while self.k_iter < n_iter_train and not self.early_stop:
self.run_validation()
self.run_early_stopping()
Expand All @@ -690,6 +689,7 @@ def run(self):

self.run_test()

self.simulate("total_offset")
self.simulate("extension_sim")

self.evaluate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,13 @@ def run_phase(self, phase_label, eta, loader):
nest.SetStatus(gen_rate_target, params_gen_rate_target)
nest.SetStatus(gen_learning_window, params_gen_learning_window)

self.simulate("total_offset")
self.simulate("extension_sim")

if self.n_iter_sim > 0:
self.evaluate()

duration["sim"] = group_size * duration["sequence"] - duration["extension_sim"]
duration["sim"] = group_size * duration["sequence"] - duration["total_offset"] - duration["extension_sim"]

self.simulate("sim")

Expand Down Expand Up @@ -754,8 +755,6 @@ def simulate(self, k):
nest.Simulate(duration[k])

def run(self):
self.simulate("total_offset")

while self.k_iter < n_iter_train and not self.early_stop:
self.run_validation()
self.run_early_stopping()
Expand All @@ -764,6 +763,7 @@ def run(self):

self.run_test()

self.simulate("total_offset")
self.simulate("extension_sim")

self.evaluate()
Expand Down

0 comments on commit a934210

Please sign in to comment.