In [3]:
def
loss_function
(
y
,
a
):
L
=
-
(
y
*
np
.
log
(
a
)
+
(
1
-
y
)
*
np
.
log
(
1
-
a
))
return
L