(graph_, n_epochs)
return graph, epochs_per_sample, head, tail, weight, n_vertices
gets elements of graphs, weights, and number of epochs per edge

    Parameters
    ----------
    graph_ : scipy.sparse.csr.csr_matrix
        umap graph of probabilities
    n_epochs : int
        maximum number of epochs per edge

    Returns
    -------
    graph scipy.sparse.csr.csr_matrix
        umap graph
    epochs_per_sample np.array
        number of epochs to train each sample for
    head np.array
        edge head
    tail np.array
        edge tail
    weight np.array
        edge weight
    n_vertices int
        number of verticies in graph
gets elements of graphs, weights, and number of epochs per edge
gets elements of graphs weights and number of epochs per edge
def get_graph_elements(graph_, n_epochs):
    """
    gets elements of graphs, weights, and number of epochs per edge

    Parameters
    ----------
    graph_ : scipy.sparse.csr.csr_matrix
        umap graph of probabilities
    n_epochs : int
        maximum number of epochs per edge

    Returns
    -------
    graph scipy.sparse.csr.csr_matrix
        umap graph
    epochs_per_sample np.array
        number of epochs to train each sample for
    head np.array
        edge head
    tail np.array
        edge tail
    weight np.array
        edge weight
    n_vertices int
        number of verticies in graph
    """
    ### should we remove redundancies () here??
    # graph_ = remove_redundant_edges(graph_)

    graph = graph_.tocoo()
    # eliminate duplicate entries by summing them together
    graph.sum_duplicates()
    # number of vertices in dataset
    n_vertices = graph.shape[1]
    # get the number of epochs based on the size of the dataset
    if n_epochs is None:
        # For smaller datasets we can use more epochs
        if graph.shape[0] <= 10000:
            n_epochs = 500
        else:
            n_epochs = 200
    # remove elements with very low probability
    graph.data[graph.data < (graph.data.max() / float(n_epochs))] = 0.0
    graph.eliminate_zeros()
    # get epochs per sample based upon edge probability
    epochs_per_sample = n_epochs * graph.data

    head = graph.row
    tail = graph.col
    weight = graph.data

    return graph, epochs_per_sample, head, tail, weight, n_vertices
def get_graph_elements ( graph_ , n_epochs ) : ### should we remove redundancies () here?? # graph_ = remove_redundant_edges(graph_) graph = graph_ . tocoo ( ) # eliminate duplicate entries by summing them together graph . sum_duplicates ( ) # number of vertices in dataset n_vertices = graph . shape [ 1 ] # get the number of epochs based on the size of the dataset if n_epochs is None : # For smaller datasets we can use more epochs if graph . shape [ 0 ] <= 10000 : n_epochs = 500 else : n_epochs = 200 # remove elements with very low probability graph . data [ graph . data < ( graph . data . max ( ) / float ( n_epochs ) ) ] = 0.0 graph . eliminate_zeros ( ) # get epochs per sample based upon edge probability epochs_per_sample = n_epochs * graph . data head = graph . row tail = graph . col weight = graph . data return graph , epochs_per_sample , head , tail , weight , n_vertices