Module Expr Str Import alias identifier Import alias identifier FunctionDef arguments args NameParam NameParam defaults body If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad NameLoad ExtSlice Index AttributeLoad NameLoad attr Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Index AttributeLoad NameLoad attr Slice Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr ListComp Call AttributeLoad SubscriptLoad NameLoad ExtSlice Index SubscriptLoad NameLoad ExtSlice Index NameLoad Slice SubscriptLoad NameLoad Index NameLoad Slice attr keyword Num comprehension NameStore Call NameLoad NameLoad Return Call AttributeLoad CompareEq NameLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad CompareEq CompareGtE NameLoad NameLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assert CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr CompareEq NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore ListComp CompareEq NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Print NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListComp CompareEq NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad Call NameLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Slice Assign NameStore SubscriptLoad Call NameLoad NameLoad ExtSlice Index AttributeLoad NameLoad attr Slice Slice Return Call NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call NameLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Slice Assign NameStore SubscriptLoad Call NameLoad NameLoad ExtSlice Index AttributeLoad NameLoad attr Slice Slice Assign NameStore Call NameLoad NameLoad NameLoad keyword Num Return Call NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A Helpers to evaluate learning results. N/A scipy.sparse sp N/A numpy np compare_labels_given_nb N/A N/A reco_label_vect true_label_vect N/A N/A N/A N/A N/A len N/A reco_label_vect shape 1 N/A N/A reco_label_vect N/A reco_label_vect N/A N/A N/A np newaxis N/A N/A true_label_vect N/A true_label_vect N/A N/A N/A np newaxis N/A N/A nb_ex N/A N/A true_label_vect shape N/A 0 N/A nb_true N/A N/A true_label_vect sum axis -1 N/A idx N/A N/A np argsort N/A reco_label_vect axis -1 N/A e N/A N/A np eye N/A N/A true_label_vect shape N/A -1 N/A reco_given_nb N/A N/A np vstack N/A N/A N/A N/A e N/A N/A N/A idx N/A N/A i N/A N/A nb_true N/A i N/A sum axis 0 N/A i N/A range nb_ex N/A N/A N/A N/A reco_given_nb true_label_vect all axis -1 N/A score_labels_given_nb N/A N/A reco_label_vect true_label_vect N/A N/A N/A N/A N/A np average N/A compare_labels_given_nb reco_label_vect true_label_vect N/A compare_labels_threshold N/A N/A reco_label_vect true_label_vect threshold N/A N/A N/A N/A N/A N/A N/A reco_label_vect threshold true_label_vect all axis -1 N/A score_labels_threshold N/A N/A reco_label_vect true_label_vect threshold N/A N/A N/A N/A N/A np average N/A compare_labels_threshold reco_label_vect true_label_vect threshold N/A chose_examples N/A N/A labels label_set number N/A None 1 N/A N/A Choses n example of each label.
     N/A N/A label_set None N/A N/A label_set N/A set labels N/A out N/A N/A l label_set N/A N/A start -1 N/A _ N/A range number N/A N/A start N/A N/A labels index l N/A start 1 N/A N/A N/A out append start N/A out N/A evaluate_label_reco N/A N/A reco_acti true_labels N/A N/A N/A Compare reconstructed label activations with true labels.
     N/A labels N/A N/A np asarray true_labels N/A best_reco N/A N/A reco_acti argmax axis 1 N/A N/A N/A best_reco shape N/A labels shape N/A N/A N/A np average N/A best_reco labels N/A scores_from_dists N/A N/A dists true_labels_0 true_labels_1 verbose N/A None False N/A N/A N/A true_labels_1 None N/A N/A N/A N/A N/A dists shape N/A 0 N/A N/A dists shape N/A 1 N/A true_labels_1 true_labels_0 N/A matching N/A N/A np argmin dists axis 1 N/A found_labels_0 N/A N/A true_labels_1 N/A m N/A m matching N/A ok N/A N/A f l N/A N/A f l N/A zip found_labels_0 true_labels_0 N/A result N/A N/A np average ok N/A verbose N/A N/A result N/A result N/A dists_to_found_labels N/A N/A dists ex_labels N/A N/A N/A matching N/A N/A np argmin dists axis 1 N/A found_labels N/A N/A ex_labels N/A m N/A m matching N/A found_labels N/A found_labels_to_score N/A N/A true found N/A N/A N/A ok N/A N/A f l N/A N/A f l N/A zip found true N/A result N/A N/A np average ok N/A result N/A found_labels_to_confusion N/A N/A true found n_labels N/A N/A N/A n_labels x n_labels matrix
    conf[i, j] is number of time label i has been classified as j.
     N/A conf N/A N/A np zeros N/A n_labels n_labels N/A N/A conf N/A N/A true found 1 N/A conf N/A todense N/A N/A X N/A N/A N/A N/A N/A sp issparse X N/A N/A N/A N/A np asarray N/A N/A X todense N/A N/A X N/A all_distances N/A N/A reco_data ex_data measure N/A N/A N/A reco_data N/A N/A todense reco_data N/A N/A N/A N/A np newaxis N/A N/A ex_data N/A N/A todense ex_data N/A N/A N/A np newaxis N/A N/A N/A N/A measure reco_data ex_data axis -1 N/A classify_NN N/A N/A reco_data ex_data ex_labels measure N/A N/A N/A For each sample in reco_data, compares it with all examples of
    ex_data.

    test_data should not contain examples that appear in reco_data
     N/A dists N/A all_distances reco_data ex_data measure N/A N/A dists_to_found_labels dists ex_labels N/A evaluate_NN_label N/A N/A reco_data test_data true_labels test_labels measure N/A N/A N/A For each sample in reco_data, compares it with all examples of
    test_data. The test is considered successful when the label corresponding
    to the sample (from true_labels) matches the label corresponding to the
    example (in test_labels).

    test_data should not contain examples that appear in reco_data
     N/A reco_data N/A N/A todense reco_data N/A N/A N/A N/A np newaxis N/A N/A test_data N/A N/A todense test_data N/A N/A N/A np newaxis N/A N/A N/A dists N/A measure reco_data test_data axis -1 N/A N/A scores_from_dists dists true_labels test_labels N/A