Beispiel #1
0
 def vjp(g):
     g_repeated,   _ = repeat_to_match_shape(g,   shape, dtype, axis, keepdims)
     ans_repeated, _ = repeat_to_match_shape(ans, shape, dtype, axis, keepdims)
     return g_repeated * b * np.exp(x - ans_repeated)
Beispiel #2
0
 def vjp(g):
     g_repeated,   _ = repeat_to_match_shape(g,   shape, dtype, axis, keepdims)
     ans_repeated, _ = repeat_to_match_shape(ans, shape, dtype, axis, keepdims)
     return g_repeated * b * anp.exp(x - ans_repeated)