Module Expr Str Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias alias alias FunctionDef arguments args NameParam defaults body If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore ListLoad If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign NameStore ListLoad Num Num Num Num Assign NameStore ListLoad Num Num Num Num Assign NameStore ListLoad Num Num Num Num orelse Assign NameStore ListLoad Num Assign NameStore ListLoad Num Assign NameStore ListLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign SubscriptStore NameLoad Slice Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad orelse Assign SubscriptStore NameLoad Slice Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr CompareLtE Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad Assert CompareEq NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpSub Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpSub BinOpMult UnaryOpUSub NameLoad NameLoad BinOpMult BinOpSub Num NameLoad NameLoad keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpSub Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpSub BinOpMult UnaryOpUSub NameLoad NameLoad BinOpMult BinOpSub Num NameLoad NameLoad keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult UnaryOpUSub NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult UnaryOpUSub NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num keyword Num keyword NameLoad Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num keyword Num keyword NameLoad Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num keyword Num keyword NameLoad Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num keyword Num keyword NameLoad Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr TupleLoad Num Num Assign NameStore BinOpDiv BinOpDiv BinOpSub NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr CompareLtE Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad Assert CompareEq NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr TupleLoad Num Num Num Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num ListLoad Num Num Num Num ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num ListLoad Num Num Num Num ListLoad Num Num Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr ListLoad BinOpAdd BinOpAdd Num Num Num BinOpAdd BinOpAdd Num Num Num Num Expr Call NameLoad Call NameLoad Num NameLoad NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num ListLoad Num Num Num Num ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num ListLoad Num Num Num Num ListLoad Num Num Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr ListLoad BinOpAdd BinOpAdd Num Num Num BinOpAdd BinOpAdd Num Num Num Num Expr Call NameLoad Call NameLoad Num keyword NameLoad NameLoad NameLoad NameLoad keyword Num decorator_list Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore BinOpMult BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareLt Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult Num BinOpPow SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub Call NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareLt Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult Num BinOpPow SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub Call NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareLt Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult Num BinOpPow SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub Call NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore BinOpMult BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareLt Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareGtE Call NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Expr Call NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword Num decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad keyword Str keyword Num Assign NameStore TupleLoad Num Num Num Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad
N/A N/A 
Test of the cost functions
 N/A itertools itt N/A numpy np neon NervanaObject neon.backends gen_backend neon.transforms CrossEntropyBinary CrossEntropyMulti SumSquared MeanSquared Misclassification PrecisionRecall SmoothL1Loss pytest_generate_tests N/A N/A metafunc N/A N/A N/A N/A fargs N/A metafunc fixturenames N/A N/A fargs N/A N/A N/A N/A N/A metafunc config option all N/A N/A shape1_rng N/A 2 3 4 5 N/A shape2_rng N/A 3 5 10 20 N/A mag_rng N/A 3 5 10 20 N/A N/A shape1_rng N/A 3 N/A shape2_rng N/A 5 N/A mag_rng N/A 10 N/A fargs N/A N/A itt product shape1_rng shape2_rng mag_rng N/A N/A N/A metafunc parametrize fargs fargs N/A compare_tensors N/A N/A func y t outputs deriv tol N/A False 0.0 N/A N/A be N/A NervanaObject be N/A temp N/A N/A be empty N/A outputs shape N/A dtypeu N/A np float32 N/A N/A deriv True N/A N/A N/A temp N/A N/A N/A func bprop N/A N/A be array N/A dtypeu y N/A N/A be array N/A dtypeu t N/A N/A N/A temp N/A N/A func N/A N/A be array N/A dtypeu y N/A N/A be array N/A dtypeu t N/A cond N/A N/A np sum N/A N/A N/A np abs N/A N/A N/A temp get outputs tol N/A N/A cond N/A N/A np prod N/A outputs shape N/A N/A 
    CrossEntropyBinary
 test_cross_entropy_binary N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 0.9 0.1 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.99 0.01 0.2 reshape N/A 4 1 N/A eps N/A N/A np exp -50 N/A expected_log N/A N/A np log N/A N/A np maximum outputs eps N/A expected_mlog N/A N/A np log N/A N/A np maximum N/A 1 outputs eps N/A expected_result N/A N/A np sum N/A N/A N/A targets expected_log N/A N/A 1 targets expected_mlog keepdims True N/A N/A compare_tensors N/A CrossEntropyBinary outputs targets expected_result tol 1e-06 N/A test_cross_entropy_binary_limits N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A eps N/A N/A np exp -50 N/A expected_log N/A N/A np log N/A N/A np maximum outputs eps N/A expected_mlog N/A N/A np log N/A N/A np maximum N/A 1 outputs eps N/A expected_result N/A N/A np sum N/A N/A N/A targets expected_log N/A N/A 1 targets expected_mlog keepdims True N/A N/A compare_tensors N/A CrossEntropyBinary outputs targets expected_result tol 1e-05 N/A test_cross_entropy_binary_derivative N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A outputs targets N/A N/A outputs shape N/A 1 N/A N/A compare_tensors N/A CrossEntropyBinary outputs targets expected_result deriv True tol 1e-06 N/A N/A 
    CrossEntropyMulti
 test_cross_entropy_multi N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 0.9 0.1 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.99 0.01 0.2 reshape N/A 4 1 N/A eps N/A N/A np exp -50 N/A expected_log N/A N/A np log N/A N/A np maximum outputs eps N/A expected_result N/A N/A np sum N/A N/A targets expected_log axis 0 keepdims True N/A N/A compare_tensors N/A CrossEntropyMulti outputs targets expected_result tol 1e-06 N/A test_cross_entropy_multi_limits N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A eps N/A N/A np exp -50 N/A expected_log N/A N/A np log N/A N/A np maximum outputs eps N/A expected_result N/A N/A np sum N/A N/A targets expected_log axis 0 keepdims True N/A N/A compare_tensors N/A CrossEntropyMulti outputs targets expected_result tol 1e-05 N/A test_cross_entropy_multi_derivative N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A outputs targets N/A N/A outputs shape N/A 1 N/A N/A compare_tensors N/A CrossEntropyMulti outputs targets expected_result deriv True tol 1e-06 N/A N/A 
    SumSquared
 test_sum_squared N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 0.9 0.1 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.99 0.01 0.2 reshape N/A 4 1 N/A expected_result N/A N/A N/A np sum N/A N/A outputs targets 2 axis 0 keepdims True 2.0 N/A N/A compare_tensors N/A SumSquared outputs targets expected_result tol 1e-08 N/A test_sum_squared_limits N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A N/A np sum N/A N/A outputs targets 2 axis 0 keepdims True 2.0 N/A N/A compare_tensors N/A SumSquared outputs targets expected_result tol 1e-07 N/A test_sum_squared_derivative N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A outputs targets N/A N/A outputs shape N/A 1 N/A N/A compare_tensors N/A SumSquared outputs targets expected_result deriv True tol 1e-08 N/A N/A 
    MeanSquared
 test_mean_squared N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 0.9 0.1 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.99 0.01 0.2 reshape N/A 4 1 N/A expected_result N/A N/A N/A np mean N/A N/A outputs targets 2 axis 0 keepdims True 2.0 N/A N/A compare_tensors N/A MeanSquared outputs targets expected_result tol 1e-08 N/A test_mean_squared_limits N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A N/A np mean N/A N/A outputs targets 2 axis 0 keepdims True 2.0 N/A N/A compare_tensors N/A MeanSquared outputs targets expected_result tol 1e-07 N/A test_mean_squared_derivative N/A N/A backend_default N/A N/A N/A outputs N/A N/A N/A N/A np array N/A 0.5 1.0 0.0 0.0001 reshape N/A 4 1 N/A targets N/A N/A N/A N/A np array N/A 0.5 0.0 1.0 0.2 reshape N/A 4 1 N/A expected_result N/A N/A N/A outputs targets N/A N/A outputs shape N/A 1 N/A N/A outputs shape N/A 0 N/A N/A compare_tensors N/A MeanSquared outputs targets expected_result deriv True tol 1e-08 N/A N/A 
    Misclassification
 compare_metric N/A N/A func y t outputs deriv tol N/A False 0.0 N/A N/A be N/A NervanaObject be N/A dtypeu N/A np float32 N/A temp N/A func N/A N/A be array N/A dtypeu y N/A N/A be array N/A dtypeu t N/A cond N/A N/A np sum N/A N/A N/A np abs N/A temp outputs tol N/A N/A cond N/A N/A np prod N/A outputs shape N/A test_misclassification N/A N/A backend_default N/A N/A N/A N/A N/A NervanaObject be bsz 3 N/A outputs N/A N/A np array N/A N/A 0.25 0.99 0.33 N/A 0.5 0.005 0.32 N/A 0.25 0.005 0.34 N/A targets N/A N/A np array N/A N/A 0 1 0 N/A 1 0 1 N/A 0 0 0 N/A expected_result N/A N/A N/A np ones N/A 1 1 3.0 N/A N/A compare_metric N/A Misclassification outputs targets expected_result tol 1e-07 N/A N/A 
    Precision / Recall
 test_precision_recall N/A N/A backend_default N/A N/A N/A be N/A NervanaObject be N/A N/A be bsz 4 N/A preds N/A N/A np array N/A N/A 0 1 0 1 N/A 1 0 0 0 N/A 0 0 1 0 N/A targets N/A N/A np array N/A N/A 0 1 0 1 N/A 1 0 1 0 N/A 0 0 0 0 N/A expected_result N/A N/A N/A np array N/A N/A N/A 1 1 0 N/A N/A 1 0.5 0 3.0 N/A N/A compare_metric N/A PrecisionRecall 3 preds targets expected_result tol 1e-06 N/A test_precision_recall_binarize N/A N/A backend_default N/A N/A N/A be N/A NervanaObject be N/A N/A be bsz 4 N/A preds N/A N/A np array N/A N/A 0.2 0.9 0.01 1 N/A 0.75 0.05 0.44 0 N/A 0.05 0.05 0.55 0 N/A targets N/A N/A np array N/A N/A 0 1 0 1 N/A 1 0 1 0 N/A 0 0 0 0 N/A expected_result N/A N/A N/A np array N/A N/A N/A 1 1 0 N/A N/A 1 0.5 0 3.0 N/A N/A compare_metric N/A PrecisionRecall 3 binarize True preds targets expected_result tol 1e-06 N/A N/A 
    Smooth L1 loss
 test_smoothL1_random N/A N/A backend_default fargs N/A N/A N/A N/A s1 s2 m fargs N/A shape N/A s1 s2 N/A magnitude m N/A outputs N/A N/A N/A N/A N/A np random random shape 0.5 magnitude N/A targets N/A N/A N/A np random random shape N/A x N/A outputs targets N/A expected_result N/A N/A np zeros shape N/A N/A I1 J1 N/A N/A np where N/A N/A abs x 1 N/A N/A I2 J2 N/A N/A np where N/A N/A abs x 1 N/A N/A expected_result N/A N/A I1 J1 N/A 0.5 N/A N/A x N/A N/A I1 J1 2 N/A N/A expected_result N/A N/A I2 J2 N/A N/A abs N/A x N/A N/A I2 J2 0.5 N/A expected_result N/A N/A np sum expected_result axis 0 keepdims True N/A N/A compare_tensors N/A SmoothL1Loss outputs targets expected_result deriv False tol 1e-05 N/A test_smoothL1_zeros N/A N/A backend_default fargs N/A N/A N/A N/A s1 s2 m fargs N/A shape N/A s1 s2 N/A outputs N/A N/A np zeros shape N/A targets N/A N/A np zeros shape N/A x N/A outputs targets N/A expected_result N/A N/A np zeros shape N/A N/A I1 J1 N/A N/A np where N/A N/A abs x 1 N/A N/A I2 J2 N/A N/A np where N/A N/A abs x 1 N/A N/A expected_result N/A N/A I1 J1 N/A 0.5 N/A N/A x N/A N/A I1 J1 2 N/A N/A expected_result N/A N/A I2 J2 N/A N/A abs N/A x N/A N/A I2 J2 0.5 N/A expected_result N/A N/A np sum expected_result axis 0 keepdims True N/A N/A compare_tensors N/A SmoothL1Loss outputs targets expected_result deriv False tol 1e-05 N/A test_smoothL1_ones N/A N/A backend_default fargs N/A N/A N/A N/A s1 s2 m fargs N/A shape N/A s1 s2 N/A outputs N/A N/A N/A np ones shape m N/A targets N/A N/A N/A np ones shape m N/A x N/A outputs targets N/A expected_result N/A N/A np zeros shape N/A N/A I1 J1 N/A N/A np where N/A N/A abs x 1 N/A N/A I2 J2 N/A N/A np where N/A N/A abs x 1 N/A N/A expected_result N/A N/A I1 J1 N/A 0.5 N/A N/A x N/A N/A I1 J1 2 N/A N/A expected_result N/A N/A I2 J2 N/A N/A abs N/A x N/A N/A I2 J2 0.5 N/A expected_result N/A N/A np sum expected_result axis 0 keepdims True N/A N/A compare_tensors N/A SmoothL1Loss outputs targets expected_result deriv False tol 1e-05 N/A test_smoothL1_random_derivative N/A N/A backend_default fargs N/A N/A N/A N/A s1 s2 m fargs N/A shape N/A s1 s2 N/A magnitude m N/A outputs N/A N/A N/A N/A N/A np random random shape 0.5 magnitude N/A targets N/A N/A N/A np random random shape N/A x N/A outputs targets N/A expected_result N/A N/A np zeros shape N/A N/A I1 J1 N/A N/A np where N/A N/A abs x 1 N/A N/A I2 J2 N/A N/A np where N/A N/A abs x 1 N/A N/A expected_result N/A N/A I1 J1 N/A x N/A N/A I1 J1 N/A N/A expected_result N/A N/A I2 J2 N/A N/A np sign N/A x N/A N/A I2 J2 N/A N/A compare_tensors N/A SmoothL1Loss outputs targets expected_result deriv True tol 1e-05 N/A N/A N/A __name__ __main__ N/A N/A be N/A gen_backend backend gpu batch_size 50 N/A fargs N/A 4 10 20 N/A N/A test_smoothL1_random be fargs N/A N/A test_smoothL1_random_derivative be fargs