|
vocabtree
0.0.1
|
Provides useful wrappers around many numerical functionality, such as dealing with sparse and dense matrix / vector data. More...
Typedefs | |
| typedef std::vector< std::pair < uint32_t, float > > | sparse_vector_t |
Functions | |
| std::vector< std::pair < uint32_t, float > > | sparsify (const cv::Mat &dense) |
| Converts the input 1D cv::Mat to a sparse format, where each pair in the vector is index, value. More... | |
| float | cos_sim (const std::vector< std::pair< uint32_t, float > > &weights0, const std::vector< std::pair< uint32_t, float > > &weights1, const std::vector< float > &idfw) |
| Converts the cosine similarity between two sparse weight vectors, which are premultiplied by the relevant entries in idfw. More... | |
| float | min_hist (const std::vector< std::pair< uint32_t, float > > &weights0, const std::vector< std::pair< uint32_t, float > > &weights1, const std::vector< float > &idfw) |
| Converts the histogram intersection (min) between two sparse weight vectors, which are premultiplied by the relevant entries in idfw. More... | |
Provides useful wrappers around many numerical functionality, such as dealing with sparse and dense matrix / vector data.
| typedef std::vector< std::pair<uint32_t, float > > numerics::sparse_vector_t |
Definition at line 10 of file numerics.hpp.
| float numerics::cos_sim | ( | const std::vector< std::pair< uint32_t, float > > & | weights0, |
| const std::vector< std::pair< uint32_t, float > > & | weights1, | ||
| const std::vector< float > & | idfw | ||
| ) |
Converts the cosine similarity between two sparse weight vectors, which are premultiplied by the relevant entries in idfw.
Sample usage would be weights0 and weights1 to represent two BoW vectors, and idfw to represent a vector of inverse document frequencies.
Definition at line 13 of file numerics.cxx.
| float numerics::min_hist | ( | const std::vector< std::pair< uint32_t, float > > & | weights0, |
| const std::vector< std::pair< uint32_t, float > > & | weights1, | ||
| const std::vector< float > & | idfw | ||
| ) |
Converts the histogram intersection (min) between two sparse weight vectors, which are premultiplied by the relevant entries in idfw.
Sample usage would be weights0 and weights1 to represent two BoW vectors, and idfw to represent a vector of inverse document frequencies.
Definition at line 48 of file numerics.cxx.
Referenced by InvertedIndex::search().
| std::vector< std::pair< uint32_t, float > > numerics::sparsify | ( | const cv::Mat & | dense | ) |
Converts the input 1D cv::Mat to a sparse format, where each pair in the vector is index, value.
This is useful for BoW features which are usually zero.
Definition at line 5 of file numerics.cxx.
Referenced by compute_bow(), compute_bow_features(), and main().