def produce_results(self, n_epoch, model, nb_tokens = 50):
img = [ ]
nb_per_primer = 8
+
for primer in [
'red above green <sep> green top <sep> blue right of red <img>',
'there is red <sep> there is yellow <sep> there is blue <img>',
acc_test_loss += loss.item() * input.size(0)
nb_test_samples += input.size(0)
- log_string(f'perplexity {k+1} train {math.exp(min(100, acc_train_loss/nb_train_samples))} test {math.exp(min(100, acc_test_loss/nb_test_samples))}')
+ train_perplexity = math.exp(min(100, acc_train_loss/nb_train_samples))
+ test_perplexity = math.exp(min(100, acc_test_loss/nb_test_samples))
+
+ log_string(f'perplexity {k+1} train {train_perplexity} test {test_perplexity}')
task.produce_results(k, model)