Module ImportFrom alias alias Import alias identifier Import alias Import alias Import alias identifier ImportFrom alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Call AttributeLoad AttributeLoad NameLoad attr attr Str ImportFrom alias alias alias alias ImportFrom alias alias ImportFrom alias alias alias Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad FunctionDef arguments args defaults body ImportFrom alias Assign NameStore Call NameLoad Call NameLoad Str Return NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword Num keyword Num keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num attr Num Num keyword Num Return NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Expr Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Assign NameStore Call NameLoad Num NameLoad Assign NameStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad CompareLt NameLoad Num Str decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore TupleLoad TupleLoad Num Num TupleLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Num Num Num Num Num Num Num Num Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Num Assign NameStore Call NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad keyword Num keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad keyword Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num TupleLoad TupleLoad Num Num TupleLoad Num Num Num Num Num Num Num Num Assign NameStore Call NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr CompareEq NameLoad Num Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr CompareGt NameLoad ListLoad Num Num Num Num Assign NameStore Call NameLoad keyword Num keyword Num keyword TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr CompareGt NameLoad ListLoad Num Num Num Num Assign NameStore Call NameLoad keyword Num keyword Num keyword TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr CompareGt NameLoad ListLoad Num Num Num Num decorator_list FunctionDef arguments args defaults body Import alias Assign NameStore Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Import alias Assign NameStore Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call NameLoad NameLoad Num Expr Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call NameLoad NameLoad Num Expr Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call NameLoad Call NameLoad NameLoad Num Expr Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call NameLoad Call NameLoad NameLoad Num Expr Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num Expr Call NameLoad Call NameLoad NameLoad Num Expr Call NameLoad NameLoad Num decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Import alias Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A nose.tools assert_true assert_equal N/A pickle pkl N/A sys N/A os N/A numpy np sklearn.cross_validation train_test_split N/A N/A N/A N/A sys path insert 1 N/A N/A N/A os path abspath .. lopq.model LOPQModel eigenvalue_allocation accumulate_covariance_estimators compute_rotations_from_accumulators lopq.search LOPQSearcher LOPQSearcherLMDB lopq.eval compute_all_neighbors get_cell_histogram get_recall N/A relpath N/A N/A N/A x N/A N/A N/A N/A os path abspath N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ x load_oxford_data N/A N/A N/A N/A lopq.utils load_xvecs N/A data N/A load_xvecs N/A relpath ../../data/oxford/oxford_features.fvecs N/A data N/A make_random_model N/A N/A N/A N/A N/A m N/A LOPQModel V 5 M 4 subquantizer_clusters 10 N/A N/A N/A m fit N/A N/A N/A N/A N/A np random RandomState 42 rand 200 8 n_init 1 N/A m N/A test_eigenvalue_allocation N/A N/A N/A N/A N/A a N/A N/A pkl load N/A open N/A relpath ./testdata/test_eigenvalue_allocation_input.pkl N/A N/A vals vecs N/A N/A N/A np linalg eigh a N/A res N/A eigenvalue_allocation 4 vals N/A expected N/A N/A np array N/A 63 56 52 48 44 40 36 30 26 22 18 14 10 6 3 0 62 57 53 51 45 41 39 33 32 31 29 25 21 17 13 9 61 58 54 49 47 42 38 34 28 24 20 16 12 8 5 2 60 59 55 50 46 43 37 35 27 23 19 15 11 7 4 1 N/A N/A assert_true N/A N/A N/A N/A np equal res expected all N/A test_eigenvalue_allocation_normalized_features N/A N/A N/A N/A N/A eigenvalues N/A N/A np array N/A 2.02255824 1.01940991 0.01569471 0.01355569 0.01264379 0.01137654 0.01108961 0.01054673 0.01023358 0.00989679 0.00939045 0.00900322 0.00878857 0.00870027 0.00850136 0.00825236 0.00813437 0.00800231 0.00790201 0.00782219 0.00763405 0.00752334 0.00739174 0.00728246 0.00701366 0.00697365 0.00677283 0.00669658 0.00654397 0.00647679 0.00630645 0.00621057 N/A indices N/A eigenvalue_allocation 2 eigenvalues N/A first_half N/A eigenvalues N/A N/A indices N/A 16 N/A second_half N/A eigenvalues N/A N/A indices N/A 16 N/A diff N/A N/A np abs N/A N/A N/A np sum N/A N/A np log first_half N/A N/A np sum N/A N/A np log second_half N/A N/A assert_true N/A diff 0.1 eigenvalue_allocation is not working correctly N/A test_accumulate_covariance_estimators N/A N/A N/A N/A N/A N/A data centroids N/A N/A pkl load N/A open N/A relpath ./testdata/test_accumulate_covariance_estimators_input.pkl N/A expected N/A N/A pkl load N/A open N/A relpath ./testdata/test_accumulate_covariance_estimators_output.pkl N/A actual N/A accumulate_covariance_estimators data centroids N/A N/A assert_true N/A N/A np allclose N/A expected N/A 0 N/A actual N/A 0 N/A N/A assert_true N/A N/A np allclose N/A expected N/A 1 N/A actual N/A 1 N/A N/A assert_true N/A N/A np array_equal N/A expected N/A 2 N/A actual N/A 2 N/A N/A assert_true N/A N/A np array_equal N/A expected N/A 3 N/A actual N/A 3 N/A N/A assert_true N/A N/A np allclose N/A expected N/A 4 N/A actual N/A 4 N/A test_compute_rotations_from_accumulators N/A N/A N/A N/A N/A N/A A mu count num_buckets N/A N/A pkl load N/A open N/A relpath ./testdata/test_compute_rotations_from_accumulators_input.pkl N/A expected N/A N/A pkl load N/A open N/A relpath ./testdata/test_compute_rotations_from_accumulators_output.pkl N/A actual N/A compute_rotations_from_accumulators A mu count num_buckets N/A N/A assert_true N/A N/A np allclose N/A expected N/A 0 N/A actual N/A 0 N/A N/A assert_true N/A N/A np allclose N/A expected N/A 1 N/A actual N/A 1 N/A test_reconstruction N/A N/A N/A N/A N/A m N/A N/A LOPQModel load_proto N/A relpath ./testdata/random_test_model.lopq N/A code N/A N/A 0 1 N/A 0 1 2 3 N/A r N/A N/A m reconstruct code N/A expected N/A -2.27444688 6.47126941 4.5042611 4.76683476 0.83671082 9.36027283 8.11780532 6.34846377 N/A N/A assert_true N/A N/A np allclose expected r N/A test_oxford5k N/A N/A N/A N/A N/A random_state 40 N/A data N/A load_oxford_data N/A N/A train test N/A train_test_split data test_size 0.2 random_state random_state N/A nns N/A compute_all_neighbors test train N/A m N/A LOPQModel V 16 M 8 N/A N/A N/A m fit train n_init 1 random_state random_state N/A N/A assert_equal N/A N/A m predict N/A test N/A 0 N/A N/A 3 2 N/A 14 164 83 49 185 29 196 250 N/A h N/A get_cell_histogram train m N/A N/A assert_equal N/A N/A np count_nonzero N/A h 0 6 N/A searcher N/A LOPQSearcher m N/A N/A N/A searcher add_data train N/A N/A recall _ N/A get_recall searcher test nns N/A N/A assert_true N/A N/A np all N/A recall N/A 0.51 0.92 0.97 0.97 N/A m2 N/A LOPQModel V 16 M 8 parameters N/A N/A m Cs None None None N/A N/A N/A m2 fit train n_init 1 random_state random_state N/A searcher N/A LOPQSearcher m2 N/A N/A N/A searcher add_data train N/A N/A recall _ N/A get_recall searcher test nns N/A N/A assert_true N/A N/A np all N/A recall N/A 0.51 0.92 0.97 0.97 N/A m3 N/A LOPQModel V 16 M 8 parameters N/A N/A m Cs N/A m Rs N/A m mus None N/A N/A N/A m3 fit train n_init 1 random_state random_state N/A searcher N/A LOPQSearcher m3 N/A N/A N/A searcher add_data train N/A N/A recall _ N/A get_recall searcher test nns N/A N/A assert_true N/A N/A np all N/A recall N/A 0.51 0.92 0.97 0.97 N/A test_proto N/A N/A N/A N/A N/A os N/A filename ./temp_proto.lopq N/A m N/A make_random_model N/A N/A N/A m export_proto filename N/A m2 N/A N/A LOPQModel load_proto filename N/A N/A assert_equal N/A m V N/A m2 V N/A N/A assert_equal N/A m M N/A m2 M N/A N/A assert_equal N/A m subquantizer_clusters N/A m2 subquantizer_clusters N/A N/A assert_true N/A N/A np allclose N/A N/A m Cs N/A 0 N/A N/A m2 Cs N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A m Rs N/A 0 N/A N/A m2 Rs N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A m mus N/A 0 N/A N/A m2 mus N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A N/A m subquantizers N/A 0 N/A 0 N/A N/A N/A m subquantizers N/A 0 N/A 0 N/A N/A N/A os remove filename N/A test_mat N/A N/A N/A N/A N/A os N/A filename ./temp_mat.mat N/A m N/A make_random_model N/A N/A N/A m export_mat filename N/A m2 N/A N/A LOPQModel load_mat filename N/A N/A assert_equal N/A m V N/A m2 V N/A N/A assert_equal N/A m M N/A m2 M N/A N/A assert_equal N/A m subquantizer_clusters N/A m2 subquantizer_clusters N/A N/A assert_true N/A N/A np allclose N/A N/A m Cs N/A 0 N/A N/A m2 Cs N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A m Rs N/A 0 N/A N/A m2 Rs N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A m mus N/A 0 N/A N/A m2 mus N/A 0 N/A N/A assert_true N/A N/A np allclose N/A N/A N/A m subquantizers N/A 0 N/A 0 N/A N/A N/A m subquantizers N/A 0 N/A 0 N/A N/A N/A os remove filename N/A searcher_instance_battery N/A N/A searcher q N/A N/A N/A 
    Helper to perform battery of searcher tests.
     N/A N/A retrieved visited N/A N/A searcher get_result_quota q N/A N/A assert_equal N/A len retrieved 12 N/A N/A assert_equal visited 3 N/A N/A retrieved visited N/A N/A searcher search q N/A N/A assert_equal N/A len retrieved 10 N/A N/A assert_equal visited 3 N/A N/A retrieved visited N/A N/A searcher get_result_quota q quota 20 N/A N/A assert_equal N/A len retrieved 28 N/A N/A assert_equal visited 5 N/A N/A retrieved visited N/A N/A searcher search q quota 20 N/A N/A assert_equal N/A len retrieved 20 N/A N/A assert_equal visited 5 N/A N/A retrieved visited N/A N/A searcher search q quota 20 limit 10 N/A N/A assert_equal N/A len retrieved 10 N/A N/A assert_equal visited 5 N/A test_searcher N/A N/A N/A N/A N/A data N/A N/A pkl load N/A open N/A relpath ./testdata/test_searcher_data.pkl N/A m N/A N/A LOPQModel load_proto N/A relpath ./testdata/random_test_model.lopq N/A q N/A N/A np ones 8 N/A searcher N/A LOPQSearcher m N/A N/A N/A searcher add_data data N/A N/A searcher_instance_battery searcher q N/A searcher N/A LOPQSearcher m N/A codes N/A N/A N/A m predict x N/A x data N/A N/A N/A searcher add_codes codes N/A N/A searcher_instance_battery searcher q N/A test_searcher_lmdb N/A N/A N/A N/A N/A shutil N/A data N/A N/A pkl load N/A open N/A relpath ./testdata/test_searcher_data.pkl N/A m N/A N/A LOPQModel load_proto N/A relpath ./testdata/random_test_model.lopq N/A lmbd_test_path ./test_lopq_lmbd N/A q N/A N/A np ones 8 N/A searcher N/A LOPQSearcherLMDB m lmbd_test_path N/A N/A N/A searcher add_data data N/A N/A searcher_instance_battery searcher q N/A N/A N/A shutil rmtree lmbd_test_path N/A searcher N/A LOPQSearcherLMDB m lmbd_test_path N/A codes N/A N/A N/A m predict x N/A x data N/A N/A N/A searcher add_codes codes N/A N/A searcher_instance_battery searcher q N/A N/A N/A shutil rmtree lmbd_test_path N/A