Skip to content

Commit 3d5060a

Browse files
committed
add a example for explaining sparse_vector
1 parent 3d1f8b4 commit 3d5060a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc_cn/ui/data_provider/pydataprovider2.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ PaddlePaddle的数据包括四种主要类型,和三种序列模式。
156156

157157
其中,f代表一个浮点数,i代表一个整数。
158158

159+
注意:对sparse_binary_vector和sparse_float_vector,PaddlePaddle存的是有值位置的索引。例如,
160+
161+
- 对一个5维非序列的稀疏01向量 ``[0, 1, 1, 0, 0]`` ,类型是sparse_binary_vector,返回的是 ``[1, 2]`` 。
162+
- 对一个5维非序列的稀疏浮点向量 ``[0, 0.5, 0.7, 0, 0]`` ,类型是sparse_float_vector,返回的是 ``[(1, 0.5), (2, 0.7)]`` 。
163+
159164
init_hook
160165
+++++++++
161166

0 commit comments

Comments
 (0)