x-tu / GGF-wcMDP

0 stars 0 forks source link

Global transition (count MDP) #44

Open x-tu opened 4 months ago

x-tu commented 4 months ago

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]

x-tu commented 4 months ago

Results

individual transitions - (left: action 0; right: action 1)

Screenshot 2024-07-12 at 23 09 43 Screenshot 2024-07-12 at 23 10 05

global transitions - (top: action [0, 0]; center: [1, 0]; down: action [0, 1])

Screenshot 2024-07-12 at 23 19 33 Screenshot 2024-07-12 at 23 19 45 Screenshot 2024-07-12 at 23 20 00

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.]

Screenshot 2024-07-12 at 23 27 27 Screenshot 2024-07-12 at 23 27 40

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]

Screenshot 2024-07-12 at 23 30 25

line5 - [0. 0. 2.] NO ACTION [0, 1, 0]

Screenshot 2024-07-12 at 23 30 42
x-tu commented 4 months ago

Solution: set the sum transitions as 1 (or any other values) when row prob sum to 0 to avoid division by 0