data_loader/data_helper.py
def split_to_batches(graphs, labels, size):
    """
    split the same size graphs array to batches of specified size
    last batch is in size num_of_graphs_this_size % size
    :param graphs: array of arrays of same size graphs
    :param labels: the corresponding labels of the graphs
    :param size: batch size
    :return: two arrays. graphs array of arrays in size (batch, num vertex, num vertex. num vertex labels)
                corresponds labels
    """
    r_graphs = []
    r_labels = []
    for k in range(len(graphs)):
        r_graphs = r_graphs + np.split(graphs[k], [j for j in range(size, graphs[k].shape[0], size)])
        r_labels = r_labels + np.split(labels[k], [j for j in range(size, labels[k].shape[0], size)])
    return np.array(r_graphs), np.array(r_labels)

    split the same size graphs array to batches of specified size
    last batch is in size num_of_graphs_this_size % size
    :param graphs: array of arrays of same size graphs
    :param labels: the corresponding labels of the graphs
    :param size: batch size
    :return: two arrays. graphs array of arrays in size (batch, num vertex, num vertex. num vertex labels)
                corresponds labels
    
split the same size graphs array to batches of specified size
last batch is in size num_of_graphs_this_size % size
split the same size graphs array to batches of specified size last batch is in size num_of_graphs_this_size % size
def split_to_batches(graphs, labels, size):
    r_graphs = []
    r_labels = []
    for k in range(len(graphs)):
        r_graphs = r_graphs + np.split(graphs[k], [j for j in range(size, graphs[k].shape[0], size)])
        r_labels = r_labels + np.split(labels[k], [j for j in range(size, labels[k].shape[0], size)])
    return np.array(r_graphs), np.array(r_labels)
def split_to_batches ( graphs , labels , size ) : r_graphs = [ ] r_labels = [ ] for k in range ( len ( graphs ) ) : r_graphs = r_graphs + np . split ( graphs [ k ] , [ j for j in range ( size , graphs [ k ] . shape [ 0 ] , size ) ] ) r_labels = r_labels + np . split ( labels [ k ] , [ j for j in range ( size , labels [ k ] . shape [ 0 ] , size ) ] ) return np . array ( r_graphs ) , np . array ( r_labels )
split the same size graphs array to batches of specified size
last batch is in size num_of_graphs_this_size % size
split the same size graphs array to batches of specified size last batch is in size num_of_graphs_this_size % size
"""
    split the same size graphs array to batches of specified size
    last batch is in size num_of_graphs_this_size % size
    :param graphs: array of arrays of same size graphs
    :param labels: the corresponding labels of the graphs
    :param size: batch size
    :return: two arrays. graphs array of arrays in size (batch, num vertex, num vertex. num vertex labels)
                corresponds labels
    """
two arrays. graphs array of arrays in size (batch, num vertex, num vertex. num vertex labels)
corresponds labels
two arrays . graphs array of arrays in size ( batch num vertex num vertex . num vertex labels ) corresponds labels
graphs
array of arrays of same size graphs
array of arrays of same size graphs
labels
the corresponding labels of the graphs
the corresponding labels of the graphs
size
None