943753c968fe7c0cbafc6e44d60f1b28b42e997b,torchsample/utils.py,,th_affine2d,#Any#Any#Any#Any#,54

Before Change



    // make a meshgrid of normal coordinates
    //coords = th_iterproduct_like(x).float()
    coords = th_iterproduct(x.size(1),x.size(2)).float()

    if center:
        // shift the coordinates so center is the origin
        coords[:,0] = coords[:,0] - (x.size(1) / 2. + 0.5)
        coords[:,1] = coords[:,1] - (x.size(2) / 2. + 0.5)
    
    // apply the coordinate transformation
    new_coords = coords.mm(A.t().contiguous()) + b.expand_as(coords)

    if center:
        // shift the coordinates back so origin is origin
        new_coords[:,0] = new_coords[:,0] + (x.size(1) / 2. + 0.5)
        new_coords[:,1] = new_coords[:,1] + (x.size(2) / 2. + 0.5)

    // map new coordinates using bilinear interpolation
    if mode == "nearest":

After Change


    b_batch = matrix[:,:,2].unsqueeze(1)

    // make a meshgrid of normal coordinates
    _coords = th_iterproduct(x.size(1),x.size(2))
    coords = _coords.unsqueeze(0).repeat(x.size(0),1,1).float()

    if center:
        // shift the coordinates so center is the origin
        coords[:,:,0] = coords[:,:,0] - (x.size(1) / 2. + 0.5)
        coords[:,:,1] = coords[:,:,1] - (x.size(2) / 2. + 0.5)
    // apply the coordinate transformation
    new_coords = coords.bmm(A_batch.transpose(1,2)) + b_batch.expand_as(coords)

    if center:
        // shift the coordinates back so origin is origin
        new_coords[:,:,0] = new_coords[:,:,0] + (x.size(1) / 2. + 0.5)
        new_coords[:,:,1] = new_coords[:,:,1] + (x.size(2) / 2. + 0.5)

    // map new coordinates using bilinear interpolation
    if mode == "nearest":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: ncullen93/torchsample
Commit Name: 943753c968fe7c0cbafc6e44d60f1b28b42e997b
Time: 2017-05-03
Author: ncullen.th@dartmouth.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_affine2d


Project Name: ncullen93/torchsample
Commit Name: 9c463e9feb288920f78a67f12c8849f1b291bfd4
Time: 2017-04-25
Author: ncullen@modv-vlan533.0658.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/functions/affine.py
Class Name:
Method Name: F_affine_3d


Project Name: ncullen93/torchsample
Commit Name: 9c463e9feb288920f78a67f12c8849f1b291bfd4
Time: 2017-04-25
Author: ncullen@modv-vlan533.0658.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/functions/affine.py
Class Name:
Method Name: F_affine_2d