def get_error_rate(network):
    """
    Returns error rate in given network

    :param Network network:network to check
    :return float: error rate in network
    """
    if network.data_loader.test_data_available:
        error_rate = 1.0 - network.test_accuracy()
    elif network.data_loader.val_data_available:
        error_rate = 1.0 - network.val_accuracy()
    else:
        raise Exception('test data and validation data not in Network')
    return error_rate