Open x-tu opened 4 months ago
individual transitions - (left: action 0; right: action 1)
global transitions - (top: action [0, 0]; center: [1, 0]; down: action [0, 1])
count transitions - (top-down: [0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]) line 0 - [2. 0. 0.] line 1 - [1. 1. 0.] line 2 - [1. 0. 1.] line 3 - [0. 2. 0.] line 4 - [0. 1. 1.] line 5 - [0. 0. 2.]
Issues HERE! caused by dividing 0
line3 - [0. 2. 0.] NO ACTION [1, 0, 0] line4 - [0. 1. 1.] NO ACTION [1, 0, 0] line5 - [0. 0. 2.] NO ACTION [1, 0, 0]
line5 - [0. 0. 2.] NO ACTION [0, 1, 0]
Solution: set the sum transitions as 1 (or any other values) when row prob sum to 0 to avoid division by 0
File "/Users/xiaohui/Documents/Code/Fair-RL/utils/count.py", line 140, in get_global_count_transitions
global_transitions /= np.sum(global_transitions, axis=1)[:, np.newaxis]