0c63b9dcd7ee3da39c74379a01d16e3a360d3506,niftynet/layer/resampler.py,ResamplerLayer,_resample_inv_dst_weighting,#ResamplerLayer#Any#Any#,178

Before Change


            self.boundary_func(tf.ceil(sample_coords), b_size)], axis=0)

        // find N weights associated to each output point
        all_coords_f = tf.to_float(all_coords)
        diff = tf.stack(
            [tf.squared_difference(sample_coords, all_coords_f[0]),
             tf.squared_difference(sample_coords, all_coords_f[1])])
        point_weights = tf.gather_nd(diff, weight_id)

After Change


        b_size = tf.reshape(
            in_spatial_size, [len(in_spatial_size)] + [1] * (len(out_size) - 1))
        // find floor and ceil coordinates
        all_coords_f = tf.to_float(tf.stack([
            self.boundary_func(tf.floor(sample_coords), b_size),
            self.boundary_func(tf.ceil(sample_coords), b_size)], axis=0))
        // find N weights associated to each output point
        diff = tf.stack(
            [tf.squared_difference(sample_coords, all_coords_f[0]),
             tf.squared_difference(sample_coords, all_coords_f[1])])

        // gather_nd for both matrix, the same as:
        // point_weights = tf.gather_nd(diff, weight_id)
        // knots_id = tf.gather_nd(all_coords_f, weight_id)
        n_val = tf.gather_nd(tf.stack([diff, all_coords_f], axis=-1), weight_id)
        n_val = tf.unstack(n_val, axis=-1)
        point_weights, knots_id = n_val[0], n_val[1]

        point_weights = tf.reduce_sum(point_weights, axis=1)
        // skip this as power = 2:
        // self.power = 2
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: NifTK/NiftyNet
Commit Name: 0c63b9dcd7ee3da39c74379a01d16e3a360d3506
Time: 2017-10-26
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/resampler.py
Class Name: ResamplerLayer
Method Name: _resample_inv_dst_weighting


Project Name: asyml/texar
Commit Name: 477c6ffca3eeccac0402d3530886e16cb5a6d7f7
Time: 2017-12-03
Author: zhiting.hu@petuum.com
File Name: txtgen/losses/mle_losses.py
Class Name:
Method Name: average_sequence_sparse_softmax_cross_entropy


Project Name: tensorflow/models
Commit Name: e76ee699899a15eb051c745efeb5ac2846399558
Time: 2017-07-20
Author: derekjchow@gmail.com
File Name: object_detection/exporter.py
Class Name:
Method Name: _export_inference_graph


Project Name: asyml/texar
Commit Name: 477c6ffca3eeccac0402d3530886e16cb5a6d7f7
Time: 2017-12-03
Author: zhiting.hu@petuum.com
File Name: txtgen/losses/mle_losses.py
Class Name:
Method Name: average_sequence_softmax_cross_entropy