if n_epoch == 0:
args = args[:1]
- c_quizzes, agreements = multithread_execution(
- generate_ae_c_quizzes,
- args,
- )
+ c_quizzes, agreements = multithread_execution(generate_ae_c_quizzes, args)
save_c_quizzes_with_scores(
models,
# None if c_quizzes is None else c_quizzes[agreements[:, model.id]],
- multithread_execution(
- one_ae_epoch,
- [
- (model, quiz_machine, n_epoch, c_quizzes, gpu)
- for model, gpu in zip(weakest_models, gpus)
- ],
- )
+ args = [
+ (model, quiz_machine, n_epoch, c_quizzes, gpu)
+ for model, gpu in zip(weakest_models, gpus)
+ ]
+
+ # Ugly hack: Only one thread during the first epoch so that
+ # compilation of the model does not explode
+ if n_epoch == 0:
+ args = args[:1]
+
+ multithread_execution(one_ae_epoch, args)
# --------------------------------------------------------------------