<jupyter_start><jupyter_text>E2E Model<jupyter_code>model_path = '../logs/e2e_opt:adam_all/'
predictor = Predictor(model_path, E2ELSTM)
train_cnfm, y, y_hat = conf_mat(train, predictor)
dev_cnfm, y_dev, y_hat_dev = conf_mat(dev, predictor)
print accuracy_score(y, y_hat)
print accuracy_score(y_dev, y_hat_dev)
print accuracy_score(y, y_hat)
print accuracy_score(y_dev, y_hat_dev)
y_hat = np.array(y_hat)
y = np.array(y)

y_hat_dev = np.array(y_hat_dev)
y_dev = np.array(y_dev)
print 'groups detection train\t', float(((y < 6) == (y_hat < 6)).sum()) / len(y)
print 'groups detection dev\t', float(((y_dev < 6) == (y_hat_dev < 6)).sum()) / len(y_dev)
print 'groups detection train\t', float(((y < 6) == (y_hat < 6)).sum()) / len(y)
print 'groups detection dev\t', float(((y_dev < 6) == (y_hat_dev < 6)).sum()) / len(y_dev)
Counter(y_hat)
Counter(y_hat_dev)
plot_confusion_matrix(train_cnfm, labels)
plot_confusion_matrix(dev_cnfm, labels)<jupyter_output><empty_output><jupyter_text>Discriminate first<jupyter_code>model_path = '../logs/dist_opt:mom_3/'
predictor = Predictor(model_path, DistLSTM)
train_cnfm, y, y_hat = conf_mat(train, predictor)
dev_cnfm, y_dev, y_hat_dev = conf_mat(dev, predictor)
print accuracy_score(y, y_hat)
print accuracy_score(y_dev, y_hat_dev)
y_hat = np.array(y_hat)
y = np.array(y)

y_hat_dev = np.array(y_hat_dev)
y_dev = np.array(y_dev)
print 'groups detection train\t', float(((y < 6) == (y_hat < 6)).sum()) / len(y)
print 'groups detection dev\t', float(((y_dev < 6) == (y_hat_dev < 6)).sum()) / len(y_dev)
float(((y_dev < 6) == (y_hat_dev < 6)).sum()) / len(y_dev)
plot_confusion_matrix(train_cnfm, labels)
plot_confusion_matrix(dev_cnfm, labels)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup