'Return the number of parameters in the network'

def count_params(self):

    n_params = 0
    for (i, p) in enumerate(self.all_params):
        n = 1
        for s in p.get_shape():
            try:
                s = int(s)
            except:
                s = 1
            if s:
                n = (n * s)
        n_params = (n_params + n)
    return n_params
