摘要: (a) 推导sigmoid的导数公式 y = 1/(1+exp( x)) Answer: y' = y (1 y) sigmoid的导数形式是十分简洁的,这也是sigmoid函数使用广泛的一个原因。 (b) 当使用交叉熵作为loss function时,推导其梯度公式,输入的y是一个one hot向 阅读全文
posted @ 2019-01-08 18:39 bernieloveslife 阅读(309) 评论(0) 推荐(0)
摘要: (a) theory 证明对于任意输入向量x和常数c,softmax的输出不会随着c的改变而改变,即softmax(x) = softmax(x+c) note:在实际使用中,经常利用这个性质,将每个元素x减去最大的那个元素,即最大值为0. 证明:利用softmax的公式分别将两边展开计算即可。 ( 阅读全文
posted @ 2019-01-08 18:36 bernieloveslife 阅读(183) 评论(0) 推荐(0)
摘要: Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example 1: Exampl 阅读全文
posted @ 2019-01-08 18:11 bernieloveslife 阅读(138) 评论(0) 推荐(0)
摘要: A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: graph[a] is a list of all n 阅读全文
posted @ 2019-01-08 14:47 bernieloveslife 阅读(260) 评论(0) 推荐(0)