'Try to sort the **cases** using the network, return the number of
misses. If **cases** is None, test all possible cases according to
the network dimensionality.'

def assess(self, cases=None):

    if (cases is None):
        cases = product((0, 1), repeat=self.dimension)
    misses = 0
    ordered = [(([0] * (self.dimension - i)) + ([1] * i)) for i in range((self.dimension + 1))]
    for sequence in cases:
        sequence = list(sequence)
        self.sort(sequence)
        misses += (sequence != ordered[sum(sequence)])
    return misses
