def num_of_weights(kernels, biases):
    """count number of weights (non-zero elements in weight matrixes).
    
    Args:
        :param kernels: list of 2D numpy arrays
        :param biases: list of 1D numpy arrays
        
    Returns:
        number_of_nonzero: number of non-zero elements in kernels & biases, int

    """

    number_of_nonzero = 0
    
    for i in range(len(kernels)):
        number_of_nonzero = number_of_nonzero + (kernels[i] != 0).sum(0).sum(0) + (biases[i] != 0).sum(0).sum(0)
        #print(number_of_nonzero)
    
    return number_of_nonzero