sparse_to_dense.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Class_Evaluation_Summarization 作者: arunrm87 项目源码 文件源码
def sparse_dense(summary):
    text_copy = copy.deepcopy(summary)
    """
    Find a suitable value for the hyperparameter, some random value like 0.5, or based
    on some heuristic like (rank of original matrix/10), or (max_singular_value of the
    original matrix / 20)
    """
    _, s, _ = randomized_svd(summary, 1, n_iter=5)
    hyperparameter = s[0] / 50

    term_document_matrix_rank = np.linalg.matrix_rank(summary)
    iterations = int(term_document_matrix_rank / 10) 

    A_new = dense(text_copy, hyperparameter, 0.02, iterations)

    return A_new
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号