MCPcopy Create free account
hub / github.com/DanielShalam/BPA / loop

Method loop

methods/pt_map/test_standard.py:156–174  ·  view source on GitHub ↗
(self, model, n_epochs=20)

Source from the content-addressed store, hash-verified

154 print("output model accuracy", acc)
155
156 def loop(self, model, n_epochs=20):
157 self.probas = model.getProbas()
158 if self.verbose:
159 print("initialisation model accuracy", self.getAccuracy(self.probas))
160
161 if self.progressBar:
162 if type(self.progressBar) == bool:
163 pb = tqdm(total=n_epochs)
164 else:
165 pb = self.progressBar
166
167 for epoch in range(1, n_epochs + 1):
168 self.performEpoch(model, epochInfo=(epoch, n_epochs))
169 if self.progressBar: pb.update()
170
171 # get final accuracy and return it
172 op_xj = model.getProbas()
173 acc = self.getAccuracy(op_xj)
174 return acc
175
176
177def get_args():

Callers 1

test_standard.pyFile · 0.45

Calls 4

getAccuracyMethod · 0.95
performEpochMethod · 0.95
getProbasMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected