jubatus_core
0.1.2
Jubatus: Online machine learning framework for distributed environment
|
#include <lsh_index_storage.hpp>
Public Member Functions | |
size_t | all_lsh_num () const |
void | clear () |
void | get_all_row_ids (std::vector< std::string > &ids) const |
void | get_diff (lsh_master_table_t &diff) const |
storage::version | get_version () const |
lsh_index_storage () | |
lsh_index_storage (size_t lsh_num, size_t table_num, uint32_t seed) | |
lsh_index_storage (size_t table_num, const std::vector< float > &shift) | |
void | mix (const lsh_master_table_t &lhs, lsh_master_table_t &rhs) const |
MSGPACK_DEFINE (master_table_, master_table_diff_, lsh_table_, lsh_table_diff_, shift_, table_num_, key_manager_) | |
std::string | name () const |
void | pack (framework::packer &packer) const |
bool | put_diff (const lsh_master_table_t &mixed_diff) |
void | remove_row (const std::string &row) |
void | set_row (const std::string &row, const std::vector< float > &hash, float norm) |
void | similar_row (const std::vector< float > &hash, float norm, uint64_t probe_num, uint64_t ret_num, std::vector< std::pair< std::string, float > > &ids) const |
void | similar_row (const std::string &id, uint64_t ret_num, std::vector< std::pair< std::string, float > > &ids) const |
size_t | table_num () const |
void | unpack (msgpack::object o) |
virtual | ~lsh_index_storage () |
Private Member Functions | |
const lsh_entry * | get_lsh_entry (const std::string &row) const |
void | get_sorted_similar_rows (const jubatus::util::data::unordered_set< uint64_t > &cands, const bit_vector &query_simhash, float query_norm, uint64_t ret_num, std::vector< std::pair< std::string, float > > &ids) const |
std::vector< float > | make_entry (const std::vector< float > &hash, float norm, lsh_entry &entry) const |
void | put_empty_entry (uint64_t row_id, const lsh_entry &entry) |
lsh_master_table_t::iterator | remove_and_get_row (const std::string &row) |
void | remove_model_row (const std::string &row) |
bool | retrieve_hit_rows (uint64_t hash, size_t ret_num, jubatus::util::data::unordered_set< uint64_t > &cands) const |
void | set_mixed_row (const std::string &row, const lsh_entry &entry) |
Private Attributes | |
common::key_manager | key_manager_ |
lsh_table_t | lsh_table_ |
lsh_table_t | lsh_table_diff_ |
lsh_master_table_t | master_table_ |
lsh_master_table_t | master_table_diff_ |
std::vector< float > | shift_ |
uint64_t | table_num_ |
Definition at line 51 of file lsh_index_storage.hpp.
jubatus::core::storage::lsh_index_storage::lsh_index_storage | ( | ) |
Definition at line 127 of file lsh_index_storage.cpp.
jubatus::core::storage::lsh_index_storage::lsh_index_storage | ( | size_t | lsh_num, |
size_t | table_num, | ||
uint32_t | seed | ||
) |
Definition at line 130 of file lsh_index_storage.cpp.
References shift_.
jubatus::core::storage::lsh_index_storage::lsh_index_storage | ( | size_t | table_num, |
const std::vector< float > & | shift | ||
) |
|
virtual |
Definition at line 146 of file lsh_index_storage.cpp.
|
inline |
Definition at line 83 of file lsh_index_storage.hpp.
References shift_.
void jubatus::core::storage::lsh_index_storage::clear | ( | ) |
Definition at line 192 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::clear(), key_manager_, lsh_table_, lsh_table_diff_, master_table_, and master_table_diff_.
void jubatus::core::storage::lsh_index_storage::get_all_row_ids | ( | std::vector< std::string > & | ids | ) | const |
Definition at line 200 of file lsh_index_storage.cpp.
References master_table_, and master_table_diff_.
void jubatus::core::storage::lsh_index_storage::get_diff | ( | lsh_master_table_t & | diff | ) | const |
Definition at line 295 of file lsh_index_storage.cpp.
References master_table_diff_.
|
private |
Definition at line 472 of file lsh_index_storage.cpp.
References master_table_, and master_table_diff_.
Referenced by get_sorted_similar_rows(), and remove_model_row().
|
private |
Definition at line 436 of file lsh_index_storage.cpp.
References jubatus::core::clustering::dist(), jubatus::core::common::key_manager::get_key(), get_lsh_entry(), key_manager_, and jubatus::core::storage::lsh_entry::lsh_hash.
|
inline |
Definition at line 86 of file lsh_index_storage.hpp.
|
private |
Definition at line 373 of file lsh_index_storage.cpp.
References jubatus::core::storage::lsh_probe_generator::base(), jubatus::core::nearest_neighbor::binarize(), jubatus::core::storage::lsh_entry::lsh_hash, jubatus::core::storage::lsh_entry::norm, jubatus::core::storage::lsh_vector::push_back(), shift_, jubatus::core::storage::lsh_entry::simhash_bv, and table_num_.
Referenced by set_row().
void jubatus::core::storage::lsh_index_storage::mix | ( | const lsh_master_table_t & | lhs, |
lsh_master_table_t & | rhs | ||
) | const |
Definition at line 320 of file lsh_index_storage.cpp.
jubatus::core::storage::lsh_index_storage::MSGPACK_DEFINE | ( | master_table_ | , |
master_table_diff_ | , | ||
lsh_table_ | , | ||
lsh_table_diff_ | , | ||
shift_ | , | ||
table_num_ | , | ||
key_manager_ | |||
) |
string jubatus::core::storage::lsh_index_storage::name | ( | ) | const |
Definition at line 283 of file lsh_index_storage.cpp.
void jubatus::core::storage::lsh_index_storage::pack | ( | framework::packer & | packer | ) | const |
Definition at line 287 of file lsh_index_storage.cpp.
bool jubatus::core::storage::lsh_index_storage::put_diff | ( | const lsh_master_table_t & | mixed_diff | ) |
Definition at line 299 of file lsh_index_storage.cpp.
References lsh_table_diff_, master_table_, master_table_diff_, remove_model_row(), and set_mixed_row().
|
private |
Definition at line 353 of file lsh_index_storage.cpp.
References jubatus::core::storage::lsh_entry::lsh_hash, and lsh_table_diff_.
Referenced by remove_and_get_row(), and remove_row().
|
private |
Definition at line 331 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::get_id_const(), key_manager_, master_table_, master_table_diff_, jubatus::core::common::key_manager::NOTFOUND, and put_empty_entry().
Referenced by set_row().
|
private |
Definition at line 395 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::get_id_const(), get_lsh_entry(), key_manager_, jubatus::core::storage::lsh_entry::lsh_hash, and lsh_table_.
Referenced by put_diff().
void jubatus::core::storage::lsh_index_storage::remove_row | ( | const std::string & | row | ) |
Definition at line 170 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::get_id_const(), key_manager_, master_table_, master_table_diff_, jubatus::core::common::key_manager::NOTFOUND, and put_empty_entry().
|
private |
Definition at line 427 of file lsh_index_storage.cpp.
References lsh_table_, and lsh_table_diff_.
|
private |
Definition at line 417 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::get_id(), key_manager_, jubatus::core::storage::lsh_entry::lsh_hash, lsh_table_, and master_table_.
Referenced by put_diff().
void jubatus::core::storage::lsh_index_storage::set_row | ( | const std::string & | row, |
const std::vector< float > & | hash, | ||
float | norm | ||
) |
Definition at line 149 of file lsh_index_storage.cpp.
References jubatus::core::common::key_manager::get_id(), key_manager_, lsh_table_diff_, make_entry(), master_table_diff_, and remove_and_get_row().
Referenced by jubatus::core::recommender::euclid_lsh::update_row().
void jubatus::core::storage::lsh_index_storage::similar_row | ( | const std::vector< float > & | hash, |
float | norm, | ||
uint64_t | probe_num, | ||
uint64_t | ret_num, | ||
std::vector< std::pair< std::string, float > > & | ids | ||
) | const |
void jubatus::core::storage::lsh_index_storage::similar_row | ( | const std::string & | id, |
uint64_t | ret_num, | ||
std::vector< std::pair< std::string, float > > & | ids | ||
) | const |
|
inline |
Definition at line 79 of file lsh_index_storage.hpp.
References table_num_.
void jubatus::core::storage::lsh_index_storage::unpack | ( | msgpack::object | o | ) |
Definition at line 291 of file lsh_index_storage.cpp.
|
private |
Definition at line 132 of file lsh_index_storage.hpp.
Referenced by clear(), get_sorted_similar_rows(), remove_and_get_row(), remove_model_row(), remove_row(), set_mixed_row(), and set_row().
|
private |
Definition at line 127 of file lsh_index_storage.hpp.
Referenced by clear(), remove_model_row(), retrieve_hit_rows(), and set_mixed_row().
|
private |
Definition at line 128 of file lsh_index_storage.hpp.
Referenced by clear(), put_diff(), put_empty_entry(), retrieve_hit_rows(), and set_row().
|
private |
Definition at line 124 of file lsh_index_storage.hpp.
Referenced by clear(), get_all_row_ids(), get_lsh_entry(), put_diff(), remove_and_get_row(), remove_row(), and set_mixed_row().
|
private |
Definition at line 125 of file lsh_index_storage.hpp.
Referenced by clear(), get_all_row_ids(), get_diff(), get_lsh_entry(), put_diff(), remove_and_get_row(), remove_row(), and set_row().
|
private |
Definition at line 130 of file lsh_index_storage.hpp.
Referenced by all_lsh_num(), lsh_index_storage(), and make_entry().
|
private |
Definition at line 131 of file lsh_index_storage.hpp.
Referenced by make_entry(), and table_num().