tristanguigue / universal-correspondence-network Goto Github PK
View Code? Open in Web Editor NEWA TensorFlow implementation of the Universal Correspondence Network paper.
A TensorFlow implementation of the Universal Correspondence Network paper.
there is a piece of code in definition of the knn function
flat_feature2 = tf.reshape(feature2, (-1, feature_size_x * feature_size_y, feature_channels))
tf.subtract(tf.expand_dims(feature1_proj_at_corres, 2), tf.expand_dims(flat_feature2, 1)))
what does the code above do? I think that
the feature1_proj_at_corres should have the size of (Batch_size, nb_corr, channels)
and the flat_feature2 should have the size of (Batch_size, heigt* width,channels)
right?
so I don't know what do the tf.subtract() and the tf.expand_dims() do?
Looking forward to your reply. Thank you very much! :-)
The code in your layers.py is as follows(in the KNN definition part):
distance = tf.negative(
tf.sqrt(tf.reduce_sum(tf.square(tf.subtract(
tf.expand_dims(feature1_proj_at_corres, 2), tf.expand_dims(flat_feature2, 1))), reduction_indices=3)))
flat_indices_nearest = tf.cast(tf.argmin(distance, 2), tf.int32)
We know the result of the tf.sqrt() is non-negative value, but you use a tf.negative() to make it become non-positive value. And then you use the tf.argmin() to choose the smallest value in dim_2.
But if numbers are non-positive, the smaller number has a bigger absolute value, which means the distance is bigger. So the result is not the most similar feature?
Looking forward to your reply~ Thank you very much :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.