了解三角神经网络

时间:2020-10-04 13:44:45

标签: python deep-learning neural-network

我目前正在关注神经网络中的博客文章,在那里他使用了我无法理解的语法 他的代码是


delta = self.cost_derivative(activations[-1], y) * \ sigmoid_prime(zs[-1])

enter image description here

任何人都可以帮助我知道他要在该代码行中说什么,因为在'*'之后加上'\' >

2 个答案:

答案 0 :(得分:2)

python中的反斜杠(\)用于换行符。如果存在较大的行,可以通过添加反斜杠将其拆分为较小的行

答案 1 :(得分:1)

反斜杠只是意味着代码行在其下继续。 该行基本上等于:

delta = self.cost_derivative(activations[-1], y) * sigmoid_prime(zs[-1])