python 来自http://cs231n.github.io/python-numpy-tutorial/

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 来自http://cs231n.github.io/python-numpy-tutorial/相关的知识,希望对你有一定的参考价值。

import numpy as np

# Create the following rank 2 array with shape (3, 4)
# [[ 1  2  3  4]
#  [ 5  6  7  8]
#  [ 9 10 11 12]]
a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])

# Two ways of accessing the data in the middle row of the array.
# Mixing integer indexing with slices yields an array of lower rank,
# while using only slices yields an array of the same rank as the
# original array:
row_r1 = a[1, :]    # Rank 1 view of the second row of a  
row_r2 = a[1:2, :]  # Rank 2 view of the second row of a
print row_r1, row_r1.shape  # Prints "[5 6 7 8] (4,)"
print row_r2, row_r2.shape  # Prints "[[5 6 7 8]] (1, 4)"

# We can make the same distinction when accessing columns of an array:
col_r1 = a[:, 1]
col_r2 = a[:, 1:2]
print col_r1, col_r1.shape  # Prints "[ 2  6 10] (3,)"
print col_r2, col_r2.shape  # Prints "[[ 2]
                            #          [ 6]
                            #          [10]] (3, 1)"

以上是关于python 来自http://cs231n.github.io/python-numpy-tutorial/的主要内容,如果未能解决你的问题,请参考以下文章

cs231n 学习笔记 by qscqesze

机器学习/深度学习常用资源

机器学习-资源链接

[CS231n-CNN] Training Neural Networks Part 1 : activation functions, weight initialization, gradient

[CS231n-CNN] Training Neural Networks Part 1 : parameter updates, ensembles, dropout

SVM vs. Softmax