def write_csv(filename, train_acc, test_acc, train_loss, test_loss, train_error, test_error, epoch):
    if (epoch == 0):
        with open(filename, 'w') as f:
            f.write('train_acc,test_acc,train_loss, test_loss, train_error, test_error\n')
            f.write('{0},{1},{2},{3},{4},{5}\n'.format(train_acc[(- 1)], test_acc[(- 1)], train_loss[(- 1)], test_loss[(- 1)], train_error[(- 1)], test_error[(- 1)]))
    else:
        with open(filename, 'a') as f:
            f.write('{0},{1},{2},{3},{4},{5}\n'.format(train_acc[(- 1)], test_acc[(- 1)], train_loss[(- 1)], test_loss[(- 1)], train_error[(- 1)], test_error[(- 1)]))
def write_csv(filename, train_acc, test_acc, train_loss, test_loss, train_error, test_error, epoch):
    if (epoch == 0):
        with open(filename, 'w') as f:
            f.write('train_acc,test_acc,train_loss, test_loss, train_error, test_error\n')
            f.write('{0},{1},{2},{3},{4},{5}\n'.format(train_acc[(- 1)], test_acc[(- 1)], train_loss[(- 1)], test_loss[(- 1)], train_error[(- 1)], test_error[(- 1)]))
    else:
        with open(filename, 'a') as f:
            f.write('{0},{1},{2},{3},{4},{5}\n'.format(train_acc[(- 1)], test_acc[(- 1)], train_loss[(- 1)], test_loss[(- 1)], train_error[(- 1)], test_error[(- 1)]))