Go教程

深度学习的优化算法 (Optimization algorithms)

本文主要是介绍深度学习的优化算法 (Optimization algorithms),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Python 数组的冒号作用

It’s pretty simple really:

a[start:stop]  # items start through stop-1
a[start:]      # items start through the rest of the array
a[:stop]       # items from the beginning through stop-1
a[:]           # a copy of the whole array

也就是说:

a[1:5] is equivalent to "from 1 to 5" (5 not included)
a[1:] is equivalent to "1 to end"
a[len(a):] is equivalent to "from length of a to end"

There is also the step value, which can be used with any of the above:

a[start:stop:step] # start through not past stop, by step

The key point to remember is that the :stop value represents the first value that is not in the selected slice. So, the difference between stop and start is the number of elements selected (if step is 1, the default).

参考链接:
https://stackoverflow.com/questions/509211/understanding-slice-notation
https://stackoverflow.com/questions/4012340/colon-in-python-list-index

这篇关于深度学习的优化算法 (Optimization algorithms)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!