interpreting-rl-behavior / interpreting-rl-behavior.github.io

Code for the site https://interpreting-rl-behavior.github.io/
Creative Commons Attribution 4.0 International
0 stars 0 forks source link

Grad_hx_hx_direction_i_loadings all generate identically #30

Closed NixGD closed 2 years ago

NixGD commented 2 years ago

As first noticed in #29, the loadings for the gradients of different actions all generate identically. I believe the problem is in import_data.py, in the following lines:

# Now do the same iteratively for the PC direction loadings
grad_hx_direction_loadings_dict = {}
for idx, grads_hx_pc_direction in zip(range(min_pc_directions, max_pc_directions), grad_hx_pcs):
    grad_hx_direction_loadings_dict.update(
        {'grad_hx_hx_direction_%i_loadings' % idx:
             project_gradients_into_pc_space(grad_hx_value, pca_components,
                                             all_hx_sigma).tolist()})

grad_hx_value is being passed to each of them, which I don't think is correct. I don't have the data files necessary to run this script, so I'm not going to try to fix it.

leesharkey commented 2 years ago

Fixed in commit 3507a3b . The issue was as @NixGD described. The solution was to replace grad_hx_value with grads_hx_pc_direction.

leesharkey commented 2 years ago

Fixed in commit 3507a3b . The issue was as @NixGD described. The solution was to replace grad_hx_value with grads_hx_pc_direction.