t
Size: a a a
t
t
X[:, np.newaxis]
создает из [ 1, 2, 3 ]
матрицу [ [1], [2], [3] ]
TN
np.repeat(X[:, np.newaxis], axis=1, repeats=Y)
np.repeat(X[:, :, np.newaxis], axis=2, repeats=Y)
np.repeat(X[:, :, :, np.newaxis], axis=3, repeats=Y)
[ 1, 2, 3 ]
сделать[ [ 1, 1, 1, 1 ],
[ 2, 2, 2, 2 ],
[ 3, 3, 3, 3 ] ]
t
>>> X = np.arange(0, 12).reshape((3,4))
>>> X
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
>>> Y = 5
>>> np.repeat(X[:, :, np.newaxis], axis=2, repeats=Y)
array([[[ 0, 0, 0, 0, 0],
[ 1, 1, 1, 1, 1],
[ 2, 2, 2, 2, 2],
[ 3, 3, 3, 3, 3]],
[[ 4, 4, 4, 4, 4],
[ 5, 5, 5, 5, 5],
[ 6, 6, 6, 6, 6],
[ 7, 7, 7, 7, 7]],
[[ 8, 8, 8, 8, 8],
[ 9, 9, 9, 9, 9],
[10, 10, 10, 10, 10],
[11, 11, 11, 11, 11]]])
TN
VC
I
SL
I
SL
I
SL
SL
I
MM
G
D•
D•
A