0b4815ab2243fe76791b01451b87492c7944025a,ristretto/sketch/transforms.py,,sparse_johnson_lindenstrauss,#,60

Before Change


        raise ValueError("If supplied, axis must be in (0, 1)")

    if density is None:
        density = 1.0 / 3

    Omega = _sketches.sparse_random_map(A, l, axis, density, random_state)

    // project A onto Omega
    if axis == 0:
        return safe_sparse_dot(Omega.T, A)
    return safe_sparse_dot(A, Omega)


def fast_johnson_lindenstrauss(A, l, axis=1, random_state=None):

After Change


        raise ValueError("If supplied, axis must be in (0, 1)")

    if density is None:
        density = A.shape[0] / log(A.shape[0])

    // construct sparse sketch
    Omega = _sketches.sparse_random_map(A, l, axis, density, random_state)

    // project A onto Omega
    if axis == 0:
        Q = safe_sparse_dot(Omega.T, A)
    else:
        Q = safe_sparse_dot(A, Omega)

    if n_subspace is not None:
        Q = perform_subspace_iterations(A, Q, n_iter=n_subspace, axis=axis)

    return Q

def fast_johnson_lindenstrauss(A, l, axis=1, random_state=None):
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: erichson/ristretto
Commit Name: 0b4815ab2243fe76791b01451b87492c7944025a
Time: 2018-05-22
Author: jknox13@uw.edu
File Name: ristretto/sketch/transforms.py
Class Name:
Method Name: sparse_johnson_lindenstrauss


Project Name: google/nucleus
Commit Name: 397dace4af2db3adaec1746ab4dce36ac715cdfe
Time: 2018-11-02
Author: no-reply@google.com
File Name: nucleus/util/genomics_math.py
Class Name:
Method Name: log10_binomial


Project Name: google-research/google-research
Commit Name: f705891da38c245857f04484ac7b771a37be7571
Time: 2021-01-08
Author: barron@google.com
File Name: jaxnerf/nerf/utils.py
Class Name:
Method Name: learning_rate_decay