-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray_test.py
More file actions
49 lines (34 loc) · 1.04 KB
/
array_test.py
File metadata and controls
49 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import numpy as np
def generate_matrix_with_prob(OW, OH, B, KW, KH, IC, prob):
col_sum = KW * KH * IC
num_elements = col_sum * OW * OH * B
matrix = np.random.choice(range(1, 10), size=(col_sum, OW * OH * B), p=prob)
return matrix
# 参数设置
# OW = 4
# OH = 3
# B = 2
OW = 1
OH = 2
B = 1
KW = 2
KH = 2
IC = 1
# 自定义的概率分布
prob = [0.1, 0.1, 0.2, 0.2, 0.05, 0.05, 0.1, 0.1, 0.1]
# 生成矩阵
result_matrix = generate_matrix_with_prob(OW, OH, B, KW, KH, IC, prob)
# 打印结果
print(result_matrix)
conv_promote = {}
# conv_promote[] = {"iprec":2,"wprec":2}
# conv_promote[] = {"iprec":2,"wprec":4}
# conv_promote[] = {"iprec":2,"wprec":8}
# conv_promote[] = {"iprec":4,"wprec":2}
# conv_promote[] = {"iprec":4,"wprec":4}
# conv_promote[] = {"iprec":4,"wprec":8}
# conv_promote[] = {"iprec":8,"wprec":2}
# conv_promote[] = {"iprec":8,"wprec":4}
# conv_promote[] = {"iprec":8,"wprec":8}
a = ["low_low","low_mid","low_high","mid_low","mid_mid","mid_high","high_low","high_mid","high_high"]
import ipdb;ipdb.set_trace()