BatchCollection.py
def assembleBatchBlocks(FeatureTypes, res, ranges, N):
    """
    Code for assembling a bunch of rectangular block comparisons
    into one large matrix
    :param FeatureTypes: The types of features
    :param res: List of blocks returned from compareBatchBlock
    :param ranges: An array of block ranges, parallel with res
    :param N: The total batch is NxN
    :return Ds: A dictionary of NxN all pairs matrices, one for
        each feature type
    """
    #Assemble all blocks together
    Ds = {}
    for i in range(len(ranges)):
        [i1, i2, j1, j2] = ranges[i]
        for Feature in FeatureTypes:
            if not Feature in Ds:
                Ds[Feature] = np.zeros((N, N))
            Ds[Feature][i1:i2, j1:j2] = res[i][Feature]

    #Fill in lower triangular part
    for Feature in Ds.keys():
        Ds[Feature] = Ds[Feature] + Ds[Feature].T
        np.fill_diagonal(Ds[Feature], 0.5*np.diagonal(Ds[Feature], 0))

    return Ds

    Code for assembling a bunch of rectangular block comparisons
    into one large matrix
    :param FeatureTypes: The types of features
    :param res: List of blocks returned from compareBatchBlock
    :param ranges: An array of block ranges, parallel with res
    :param N: The total batch is NxN
    :return Ds: A dictionary of NxN all pairs matrices, one for
        each feature type
    
Code for assembling a bunch of rectangular block comparisons
into one large matrix
Code for assembling a bunch of rectangular block comparisons into one large matrix
def assembleBatchBlocks(FeatureTypes, res, ranges, N):
    Ds = {}
    for i in range(len(ranges)):
        [i1, i2, j1, j2] = ranges[i]
        for Feature in FeatureTypes:
            if not Feature in Ds:
                Ds[Feature] = np.zeros((N, N))
            Ds[Feature][i1:i2, j1:j2] = res[i][Feature]
    for Feature in Ds.keys():
        Ds[Feature] = Ds[Feature] + Ds[Feature].T
        np.fill_diagonal(Ds[Feature], 0.5*np.diagonal(Ds[Feature], 0))
    return Ds
def assembleBatchBlocks ( FeatureTypes , res , ranges , N ) : Ds = { } for i in range ( len ( ranges ) ) : [ i1 , i2 , j1 , j2 ] = ranges [ i ] for Feature in FeatureTypes : if not Feature in Ds : Ds [ Feature ] = np . zeros ( ( N , N ) ) Ds [ Feature ] [ i1 : i2 , j1 : j2 ] = res [ i ] [ Feature ] for Feature in Ds . keys ( ) : Ds [ Feature ] = Ds [ Feature ] + Ds [ Feature ] . T np . fill_diagonal ( Ds [ Feature ] , 0.5 * np . diagonal ( Ds [ Feature ] , 0 ) ) return Ds
Code for assembling a bunch of rectangular block comparisons
into one large matrix
Code for assembling a bunch of rectangular block comparisons into one large matrix
"""
    Code for assembling a bunch of rectangular block comparisons
    into one large matrix
    :param FeatureTypes: The types of features
    :param res: List of blocks returned from compareBatchBlock
    :param ranges: An array of block ranges, parallel with res
    :param N: The total batch is NxN
    :return Ds: A dictionary of NxN all pairs matrices, one for
        each feature type
    """ #Assemble all blocks together #Fill in lower triangular part
A dictionary of NxN all pairs matrices, one for
each feature type
A dictionary of NxN all pairs matrices one for each feature type
Ds
FeatureTypes
The types of features
The types of features
res
List of blocks returned from compareBatchBlock
List of blocks returned from compareBatchBlock
ranges
An array of block ranges, parallel with res
An array of block ranges parallel with res
N
The total batch is NxN
The total batch is NxN