Skip to content

Commit

Permalink
fix bug in data_utils.py for Issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
xlxwalex committed Mar 7, 2023
1 parent 3c6dd37 commit 8cd55a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion model/STG-correction/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,15 @@ def convert_spmap_sw(sp_map : list, sw_labels : np.array) -> list:
def convert_spmap_tg(sp_map : list, tg_mapper : list) -> list:
new_spmap = []
for idx in range(len(sp_map)):
if idx == 163:
print()
spmapper = sp_map[idx]
tgmapper = tg_mapper[idx]
mapper = {}
if not spmapper: new_spmap.append(None)
else:
for sp in spmapper:
if sp in tgmapper and tgmapper[sp] > 0: mapper[tgmapper[sp]] = spmapper[sp]
if sp in tgmapper and tgmapper[sp] >= 0: mapper[tgmapper[sp]] = spmapper[sp]
new_spmap.append(mapper)
return new_spmap

Expand Down

0 comments on commit 8cd55a2

Please sign in to comment.