Module Import alias Import alias identifier ImportFrom alias ImportFrom alias alias alias alias alias alias FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign AttributeStore NameLoad attr Call NameLoad Num Num Assign AttributeStore NameLoad attr Call NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Slice AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Slice Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr CompareGtE Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad BinOpMult NameLoad AttributeLoad NameLoad attr BinOpMult NameLoad AttributeLoad NameLoad attr Expr Call NameLoad BinOpMult NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign SubscriptStore NameLoad Index TupleLoad Num Num Num Assign NameStore BinOpMult Num Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Num Num Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Assign NameStore Call NameLoad NameLoad Assert Call AttributeLoad NameLoad attr CompareLtELtE Num NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Assign NameStore Call NameLoad NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign SubscriptStore NameLoad Index TupleLoad Num Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num Expr Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num Assign NameStore BinOpMult Num Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num attr TupleLoad Num Num Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr keyword Num Call NameLoad Call AttributeLoad NameLoad attr keyword Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num attr TupleLoad Num Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad BinOpMult SubscriptLoad Call AttributeLoad NameLoad attr keyword Num ExtSlice Index AttributeLoad NameLoad attr Slice SubscriptLoad Call AttributeLoad NameLoad attr keyword Num ExtSlice Slice Index AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad keyword Num Num Expr Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad keyword Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr CompareLtE Call NameLoad NameLoad keyword Num Call NameLoad Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr CompareLtE Call NameLoad NameLoad keyword Num Call NameLoad Call AttributeLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult ListLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad BinOpMult Num NameLoad BinOpMult Num NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Num Call NameLoad Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Num Call NameLoad Call AttributeLoad NameLoad attr keyword Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr CompareEq Call NameLoad NameLoad NameLoad keyword Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr CompareEq Call NameLoad NameLoad NameLoad keyword Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad Call NameLoad NameLoad NameLoad attr TupleLoad Num Expr Call AttributeLoad NameLoad attr AttributeLoad Call NameLoad NameLoad NameLoad keyword Num attr TupleLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Num BinOpDiv Num Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A unittest N/A numpy np numpy.testing assert_array_almost_equal multimodal.lib.metrics generalized_KL hoyer_sparseness entropy mutual_information conditional_entropy cosine_similarity random_NN_matrix N/A N/A h w N/A N/A N/A N/A N/A np abs N/A N/A N/A np random random N/A h w N/A TestGenenralizedKL N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A N/A N/A np random seed 42 N/A N/A self x N/A random_NN_matrix 10 15 N/A N/A self y N/A random_NN_matrix 10 15 N/A test_returns_scalar N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A N/A np isscalar N/A generalized_KL N/A self x N/A self y N/A test_raises_ValueError_0 N/A N/A self N/A N/A N/A N/A N/A self assertRaises ValueError N/A N/A N/A generalized_KL N/A N/A self x N/A N/A -1 N/A N/A self y N/A test_raises_ValueError_1 N/A N/A self N/A N/A N/A N/A N/A self assertRaises ValueError N/A N/A N/A generalized_KL N/A N/A self x N/A N/A N/A 1 N/A self y N/A test_is_NN N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A N/A generalized_KL N/A self x N/A self y 0 N/A test_is_0_on_same N/A N/A self N/A N/A N/A N/A assert_array_almost_equal N/A generalized_KL N/A self x N/A self x 0 N/A test_is_1_homogenous N/A N/A self N/A N/A N/A dkl N/A generalized_KL N/A self x N/A self y N/A a N/A N/A N/A np random random N/A adkl N/A generalized_KL N/A a N/A self x N/A a N/A self y N/A N/A assert_array_almost_equal N/A a dkl adkl decimal 5 N/A test_values N/A N/A self N/A N/A N/A x N/A N/A np zeros N/A 4 2 N/A N/A x N/A N/A 1 1 1 N/A y N/A 0.5 N/A N/A np ones N/A 4 2 N/A dkl N/A generalized_KL x y N/A ok N/A N/A N/A np log 2.0 3.0 N/A N/A assert_array_almost_equal dkl ok N/A test_axis N/A N/A self N/A N/A N/A dkl N/A generalized_KL N/A self x N/A self y axis 1 N/A N/A N/A self assertEqual N/A dkl shape N/A 10 N/A dkl N/A generalized_KL N/A self x N/A self y axis 0 N/A N/A N/A self assertEqual N/A dkl shape N/A 15 N/A N/A TestHoyerSparseness N/A N/A unittest TestCase N/A test_is_in_0_1 N/A N/A self N/A N/A N/A x N/A N/A N/A np random random N/A 5 7 N/A s N/A hoyer_sparseness x N/A N/A N/A np all N/A 0 s 1 N/A test_axis N/A N/A self N/A N/A N/A x N/A N/A np array N/A N/A 1 1 N/A 0 0 N/A s1 N/A hoyer_sparseness x axis 0 N/A N/A N/A self assertEqual s1 1.0 N/A test_is_0_on_flat N/A N/A self N/A N/A N/A x N/A N/A np ones N/A 1 4 N/A N/A N/A self assertAlmostEqual N/A hoyer_sparseness x 0.0 N/A test_is_1_on_spike N/A N/A self N/A N/A N/A x N/A N/A np zeros N/A 1 4 N/A N/A x N/A N/A 0 2 10.0 N/A N/A N/A self assertEqual N/A hoyer_sparseness x 1.0 N/A test_zero N/A N/A self N/A N/A N/A x N/A N/A np zeros N/A 2 3 N/A s1 N/A hoyer_sparseness x N/A N/A N/A self assertEqual s1 1.0 N/A N/A TestEntropy N/A N/A unittest TestCase N/A test_is_positive N/A N/A self N/A N/A N/A p N/A N/A N/A np random dirichlet N/A N/A 3.0 10 N/A N/A N/A self assertTrue N/A N/A entropy p 0 N/A test_is_symetric N/A N/A self N/A N/A N/A p N/A N/A N/A np random dirichlet N/A N/A 3.0 10 N/A e1 N/A entropy p N/A N/A N/A N/A np random shuffle p N/A e2 N/A entropy p N/A N/A N/A self assertAlmostEqual e1 e2 N/A test_is_log_n_on_equi N/A N/A self N/A N/A N/A p N/A N/A N/A np ones N/A 10 10.0 N/A N/A N/A self assertAlmostEqual N/A entropy p N/A N/A np log 10.0 N/A test_is_0_on_deterministic N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A entropy N/A N/A np array N/A 0 1 0 N/A N/A TestMutualInformation N/A N/A unittest TestCase N/A test_is_positive N/A N/A self N/A N/A N/A p N/A N/A N/A N/A N/A np random dirichlet N/A N/A 3.0 10 reshape N/A 2 5 N/A N/A N/A self assertTrue N/A N/A mutual_information p 0 N/A test_is_0_on_indep N/A N/A self N/A N/A N/A p N/A N/A N/A np random dirichlet N/A N/A 3.0 10 N/A p N/A 0.5 N/A N/A np vstack N/A p p N/A N/A N/A self assertAlmostEqual N/A mutual_information p 0 N/A test_fits_relation_to_entropy N/A N/A self N/A N/A N/A p N/A N/A N/A N/A N/A np random dirichlet N/A N/A 3.0 10 reshape N/A 2 5 N/A info1 N/A mutual_information p N/A info2 N/A N/A N/A entropy N/A N/A p sum axis 0 N/A entropy N/A N/A p sum axis 1 N/A entropy p N/A N/A N/A self assertAlmostEqual info1 info2 N/A test_is_one_bit N/A N/A self N/A N/A N/A p N/A N/A np array N/A N/A 0.5 0.0 N/A 0.0 0.5 N/A N/A N/A self assertAlmostEqual N/A mutual_information p N/A N/A np log 2.0 N/A test_fits_relation_to_KL N/A N/A self N/A N/A N/A p N/A N/A N/A N/A N/A np random dirichlet N/A N/A 3.0 10 reshape N/A 2 5 N/A i N/A mutual_information p N/A d N/A generalized_KL N/A N/A p flatten N/A N/A N/A N/A N/A N/A p sum axis 0 N/A N/A N/A np newaxis N/A N/A N/A N/A p sum axis 1 N/A N/A N/A N/A np newaxis flatten N/A N/A N/A self assertAlmostEqual i d N/A N/A TestConditionalEntropy N/A N/A unittest TestCase N/A test_is_positive N/A N/A self N/A N/A N/A p N/A N/A N/A N/A N/A np random dirichlet N/A N/A 3.0 10 reshape N/A 2 5 N/A N/A N/A self assertTrue N/A N/A conditional_entropy p axis 0 0 N/A N/A N/A self assertTrue N/A N/A conditional_entropy p axis 1 0 N/A test_is_less_than_entropy N/A N/A self N/A N/A N/A p N/A N/A N/A N/A N/A np random dirichlet N/A N/A 3.0 10 reshape N/A 2 5 N/A N/A N/A self assertTrue N/A N/A conditional_entropy p axis 0 N/A entropy N/A N/A p sum axis 0 N/A N/A N/A self assertTrue N/A N/A conditional_entropy p axis 1 N/A entropy N/A N/A p sum axis 1 N/A test_on_independant N/A N/A self N/A N/A N/A p N/A N/A N/A np random dirichlet N/A N/A 3.0 10 N/A p N/A N/A np vstack N/A N/A 0.2 p N/A 0.8 p N/A N/A N/A self assertAlmostEqual N/A conditional_entropy p axis 0 N/A entropy N/A N/A p sum axis 0 N/A N/A N/A self assertAlmostEqual N/A conditional_entropy p axis 1 N/A entropy N/A N/A p sum axis 1 N/A N/A TestCosineSimilarity N/A N/A unittest TestCase N/A test_0_on_0 N/A N/A self N/A N/A N/A a N/A N/A np zeros N/A 4 5 N/A N/A N/A self assertTrue N/A N/A np all N/A N/A cosine_similarity a a axis 0 0 N/A N/A N/A self assertTrue N/A N/A np all N/A N/A cosine_similarity a a axis 1 0 N/A test_shapes N/A N/A self N/A N/A N/A a N/A N/A N/A np random random N/A 4 5 N/A b N/A N/A N/A np random random N/A 4 5 N/A N/A N/A self assertEqual N/A N/A cosine_similarity a b shape N/A 4 N/A N/A N/A self assertEqual N/A N/A cosine_similarity a b axis 0 shape N/A 5 N/A test_on_ex N/A N/A self N/A N/A N/A a N/A N/A np vstack N/A N/A N/A np eye 3 N/A N/A np ones N/A 1 3 N/A b N/A N/A np array N/A N/A 1.0 0.0 0.0 N/A 1.0 1.0 0.0 N/A 1.0 0.0 0.0 N/A 0.0 2.0 1.0 N/A ok N/A N/A np sqrt N/A N/A np array N/A 1.0 0.5 0.0 N/A 3.0 5.0 N/A N/A N/A N/A np testing assert_allclose N/A cosine_similarity a b ok N/A N/A