You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In current master branch, we calculate the GTC by calling srl_zoo/plotting/representation_plot.py. In particular, in the function plotCorrelation, we call numpy to compute the correlation.
However in the numpy.corrcoef doc, they spefify that numpy.corrcoef(x, y=None, rowvar=True, bias=<no value>, ddof=<no value>)y should have the same shape as x. In fact, if we replace this line of code by
corr=np.corrcoef(x=x+eps, y=np.random.rand(x.shape[0], 200) +eps, rowvar=0) ## where 200 is the state dim
and execute N times, the results will be almost the same (absolute difference is less than 1e-5).
Code example Replace the predcited state by a random matrix as described above and execute the following command line under the folde srl_zoo/ :
I have just written a function that computes the GTC (ground truth correlation) for any dimension of states. It also takes care the case where the ground truth vectors are identical (e.g. fixed target position) and return 0 in this case. The results are coherent with the np.corrcoef and are different from the current origin/master code. This means that the previous calculation of GTC might be wrong. I hope that I didn't misunderstand the GTC...
Describe the bug
In current master branch, we calculate the GTC by calling srl_zoo/plotting/representation_plot.py. In particular, in the function
plotCorrelation
, we call numpy to compute the correlation.However in the numpy.corrcoef doc, they spefify that
numpy.corrcoef(x, y=None, rowvar=True, bias=<no value>, ddof=<no value>)
y should have the same shape as x. In fact, if we replace this line of code byand execute N times, the results will be almost the same (absolute difference is less than 1e-5).
Code example
Replace the predcited state by a random matrix as described above and execute the following command line under the folde srl_zoo/ :
$ python -m plotting.representation_plot -i "./logs/mobile2D_random_tar_seed_0/19-05-28_18h28_22_custom_cnn_ST_DIM200_autoencoder/states_rewards.npz" --correlation --data-folder "mobile2D_random_tar_seed_0" --print-corr
p.s. replace the folder name 19-05-28_18h28_22_custom_cnn_ST_DIM200_autoencoder according to yours, of course.
The text was updated successfully, but these errors were encountered: