def smoothed_epmi(matrix, alpha=0.75):
    """
    Performs smoothed epmi.
    See smoothed_ppmi for more info.
    Derived from this:

    #(w,c) / #(TOT)
    --------------
    (#(w) / #(TOT)) * (#(c)^a / #(TOT)^a)
    ==>
    #(w,c) / #(TOT)
    --------------
    (#(w) * #(c)^a) / #(TOT)^(a+1))
    ==>
    #(w,c)
    ----------
    (#(w) * #(c)^a) / #(TOT)^a
    ==>
    #(w,c) * #(TOT)^a
    ----------
    #(w) * #(c)^a
    """

    row_sum = matrix.sum(axis=1)
    col_sum = matrix.sum(axis=0).power(alpha)
    total = row_sum.sum(axis=0).power(alpha)[0, 0]
    inv_col_sum = 1 / col_sum  # shape (1,n)
    inv_row_sum = 1 / row_sum      # shape (n,1)
    inv_col_sum = inv_col_sum * total

    mat = matrix * inv_row_sum
    mat = mat * inv_col_sum
    return mat