def conv_params(sz_in: int, sz_out: int):
    """Solves for filter_size, padding and stride per the following equation,
       sz_out = (sz_in - filter_size + 2*padding) / stride + 1
       Attempts to find a solution by iterating over various filter_size, stride and padding
       in that order. If no solution is found, raises an error
    """
    filter_size, stride, padding = [3,2,4,5], [2,1,3], [1,2,3]
    for f in filter_size:
        for s in stride:
            for p in padding:
                if ((sz_in - f + 2*p) / s + 1) == sz_out:
                    return (f, s, p)
    raise Exception("Unable to find valid parameters for {0} to {1} convolution".format(sz_in, sz_out))