Files
rl_2d_walker.js/scripts/view_log.ipynb
T
2018-12-02 16:00:19 +08:00

248 KiB

In [76]:
%pylab inline
import pandas as pd
import os
import glob
Populating the interactive namespace from numpy and matplotlib
In [ ]:
In [77]:
latest_log = sorted(glob.glob('../outputs/*.log'))[-1]
latest_log
Out [77]:
'../outputs/train_2018-12-02_11-57-52.log'
In [ ]:
In [78]:
datas = []
data = {}
for line in open(latest_log).readlines():
    if line.startswith('metric'):
        _, name, val = line.strip('\n').split(' ', 2)
        val = float(val)
        if name=='episodeSteps':
            steps=val
            if len(data): datas.append(data)
            data = {}
        data[name] = val
    
#         print(steps, name,val)
In [79]:
df = pd.DataFrame(datas)
df = df.set_index('steps')
df
Out [79]:
ActorLoss CriticLoss EpisodeDuration NoiseDistance Reward bonus_happiness episodeSteps head_height_reward leg_switch_reward lin_vel_reward position quad_contact_cost quad_joint_angle_cost quad_power_cost reward
steps
4000.5 NaN NaN 800.0 1.001085 15.428472 40.0 400.5 9.125332 0.285500 0.070601 1.548446 -2.472562 -0.601705 -0.121749 15.428472
8000.5 NaN NaN 800.0 0.994691 -24.003403 40.0 400.5 -50.378863 0.232750 0.077041 1.705007 -2.120969 -0.548225 -0.124130 -4.287465
12000.5 NaN NaN 800.0 1.019849 -27.004394 40.0 400.5 -72.992035 0.186500 0.020328 1.828903 -2.127979 -0.520995 -0.145143 -11.859775
16000.5 NaN NaN 800.0 1.013509 -18.811241 40.0 400.5 -78.189635 0.186500 0.022882 2.054154 -2.119297 -0.542288 -0.151087 -13.597642
20000.5 NaN NaN 800.0 0.966068 -29.553983 40.0 400.5 -87.854409 0.209900 0.009446 2.018187 -2.046362 -0.523966 -0.161338 -16.788910
24000.5 191.363654 2787.138015 800.0 0.986174 -20.272949 40.0 400.5 -89.615552 0.193083 -0.015976 1.956940 -1.997354 -0.509704 -0.163246 -17.369583
28000.5 208.339470 2542.897098 800.0 0.952842 -31.488694 40.0 400.5 -95.714551 0.214857 0.035294 1.921250 -2.007009 -0.513981 -0.174407 -19.386599
32000.5 214.446994 3204.433846 800.0 1.064732 -19.854985 40.0 400.5 -95.809296 0.194812 -0.008265 1.903555 -2.033891 -0.508228 -0.170573 -19.445147
36000.5 219.025467 3763.665469 800.0 1.011534 -31.246213 40.0 400.5 -99.759212 0.194111 0.008420 1.836762 -2.032618 -0.506536 -0.173296 -20.756377
40000.5 222.761831 4402.325286 800.0 0.901060 -19.233865 40.0 400.5 -99.335485 0.195500 0.005288 1.849608 -2.000762 -0.501912 -0.175004 -20.604125
44000.5 192.925095 6175.267422 800.0 0.907664 -12.129763 40.0 400.5 -97.021365 0.185091 0.003564 1.776524 -1.996920 -0.496669 -0.174887 -19.833729
48000.5 186.271498 7918.174082 800.0 0.749639 10.577317 40.0 400.5 -89.403447 0.182167 -0.002658 1.644775 -2.001734 -0.496787 -0.175965 -17.299475
52000.5 182.367172 9496.571895 800.0 0.706705 -9.020571 40.0 400.5 -87.510926 0.178231 0.002521 1.660926 -1.990582 -0.490189 -0.176964 -16.662636
56000.5 209.881061 11588.859424 800.0 0.686202 -9.436242 40.0 400.5 -85.972747 0.199179 0.005499 1.680981 -1.995598 -0.499409 -0.176319 -16.146465
60000.5 203.770711 13639.273037 800.0 0.612119 -31.330872 40.0 400.5 -88.983683 0.191333 0.008175 1.692749 -2.012542 -0.503418 -0.176143 -17.158759
64000.5 220.845039 16973.926318 800.0 0.600943 -5.644547 40.0 400.5 -86.825863 0.202906 0.000194 1.673126 -2.014898 -0.503954 -0.175746 -16.439121
68000.5 237.482885 19318.055244 800.0 0.577887 -28.311395 40.0 400.5 -88.945980 0.205118 0.021373 1.684573 -2.020250 -0.496782 -0.175948 -17.137490
72000.5 233.844463 23049.072451 800.0 0.437918 -19.292133 40.0 400.5 -89.266078 0.196333 0.004747 1.724214 -2.034951 -0.492618 -0.179009 -17.257192
76000.5 258.211864 25861.567061 800.0 0.343572 -4.006912 40.0 400.5 -87.196266 0.207684 0.010595 1.741209 -2.030655 -0.491321 -0.179465 -16.559809
80000.5 259.855144 29057.213398 800.0 0.305389 -30.271102 40.0 400.5 -89.240322 0.202325 0.002668 1.764335 -2.028444 -0.492691 -0.179657 -17.245374
84000.5 302.923168 34809.407969 800.0 0.198288 -14.004152 40.0 400.5 -88.774951 0.202262 0.000983 1.760559 -2.030735 -0.492974 -0.177674 -17.091030
88000.5 292.210404 36090.210684 800.0 0.283443 -42.098855 40.0 400.5 -92.166832 0.200818 -0.005441 1.798274 -2.036281 -0.495948 -0.179564 -18.227749
92000.5 348.208931 41075.092363 800.0 0.270578 -9.238977 40.0 400.5 -91.002878 0.206109 0.006316 1.792339 -2.038217 -0.503308 -0.178819 -17.836933
96000.5 391.587693 42182.473066 800.0 0.365521 -43.590564 40.0 400.5 -94.232951 0.208187 0.000129 1.777263 -2.026099 -0.500903 -0.178367 -18.910001
100000.5 363.875681 46710.245020 800.0 0.380616 -43.440455 40.0 400.5 -97.170620 0.202540 -0.004936 1.748328 -2.017295 -0.501833 -0.181513 -19.891219
104000.5 339.817678 50106.874199 800.0 0.342616 -3.568891 40.0 400.5 -95.303719 0.208385 0.004970 1.811393 -2.015716 -0.500457 -0.183773 -19.263437
108000.5 313.327876 51655.751445 800.0 0.393287 -24.874761 40.0 400.5 -95.933077 0.212852 -0.002024 1.807105 -2.014319 -0.496048 -0.181175 -19.471264
112000.5 270.483027 57878.171953 800.0 0.357968 -3.441934 40.0 400.5 -94.227149 0.206036 0.007996 1.810939 -2.010103 -0.492748 -0.180397 -18.898788
116000.5 226.045801 59847.391836 800.0 0.402686 -9.032035 40.0 400.5 -93.198698 0.201259 -0.004129 1.782489 -2.000569 -0.492186 -0.181342 -18.558555
120000.5 255.274086 60727.864102 800.0 0.379667 1.487278 40.0 400.5 -91.195735 0.196033 -0.004114 1.788853 -1.995646 -0.490633 -0.180987 -17.890361
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
308000.5 358.649947 138975.352969 800.0 0.144606 -28.710064 40.0 400.5 -95.784777 0.174526 0.001890 1.840785 -2.014213 -0.489832 -0.181992 -19.431466
312000.5 337.754779 140220.738906 800.0 0.119360 -23.076090 40.0 400.5 -95.927744 0.177077 0.002362 1.832647 -2.014661 -0.489650 -0.181962 -19.478192
316000.5 259.325153 140588.052891 800.0 0.129157 -24.336979 40.0 400.5 -96.117792 0.182222 0.001274 1.835341 -2.012020 -0.490779 -0.181994 -19.539696
320000.5 252.825544 146814.529766 800.0 0.126677 2.020660 40.0 400.5 -95.309802 0.182613 -0.000708 1.829982 -2.011155 -0.488976 -0.182546 -19.270191
324000.5 311.681400 148886.869453 800.0 0.104543 -15.302837 40.0 400.5 -95.163531 0.182605 0.001098 1.820914 -2.012655 -0.488455 -0.182696 -19.221212
328000.5 312.720243 152494.040937 800.0 0.097410 -21.306948 40.0 400.5 -95.239122 0.181305 0.000272 1.819064 -2.012011 -0.487911 -0.182476 -19.246648
332000.5 312.151625 151137.147109 800.0 0.156087 -26.898011 40.0 400.5 -95.512951 0.182747 0.000838 1.816929 -2.015391 -0.488862 -0.182880 -19.338833
336000.5 297.019186 154205.585469 800.0 0.150449 -15.047147 40.0 400.5 -95.359666 0.183810 0.001657 1.822713 -2.017940 -0.488056 -0.183028 -19.287741
340000.5 347.804802 150311.306328 800.0 0.112766 -14.734657 40.0 400.5 -95.205255 0.186147 0.001543 1.822670 -2.014554 -0.487522 -0.182885 -19.234176
344000.5 298.215561 165119.265234 800.0 0.120098 -25.377967 40.0 400.5 -95.419098 0.186250 -0.001282 1.820896 -2.012657 -0.486891 -0.183168 -19.305615
348000.5 367.198066 164362.320156 800.0 0.143425 -9.835368 40.0 400.5 -95.096557 0.185724 -0.001203 1.815989 -2.007950 -0.487463 -0.182836 -19.196762
352000.5 421.867589 172558.451094 800.0 0.161740 -45.918617 40.0 400.5 -96.016492 0.185682 0.000611 1.827056 -2.000303 -0.487114 -0.183640 -19.500419
356000.5 399.980753 170143.568750 800.0 0.134694 -28.956869 40.0 400.5 -96.334658 0.185433 0.001569 1.827713 -2.001134 -0.486855 -0.184369 -19.606671
360000.5 323.039328 177826.681328 800.0 0.119141 -18.324828 40.0 400.5 -96.291717 0.186406 0.000798 1.827721 -2.000875 -0.487775 -0.184123 -19.592429
364000.5 350.858816 182020.647344 800.0 0.122827 10.592855 40.0 400.5 -95.296701 0.188764 -0.001131 1.815978 -2.000109 -0.488048 -0.184941 -19.260722
368000.5 158.930903 177610.984453 800.0 0.118055 -9.164740 40.0 400.5 -94.969708 0.191533 0.001028 1.816592 -2.003416 -0.487366 -0.185021 -19.150983
372000.5 190.317296 180786.817500 800.0 0.135613 9.583231 40.0 400.5 -94.042892 0.191065 0.001168 1.816862 -2.002914 -0.486753 -0.185713 -18.842013
376000.5 223.448859 191507.754922 800.0 0.130242 -13.130436 40.0 400.5 -93.857549 0.191415 0.000406 1.818154 -2.007324 -0.485283 -0.185419 -18.781252
380000.5 193.026997 187127.255469 800.0 0.142632 -20.573801 40.0 400.5 -93.914095 0.189837 0.001001 1.821333 -2.007509 -0.484451 -0.185144 -18.800121
384000.5 355.778719 188473.558984 800.0 0.120989 -31.464281 40.0 400.5 -94.306487 0.188474 -0.001194 1.822966 -2.007951 -0.483834 -0.185125 -18.932039
388000.5 307.473244 198413.550000 800.0 0.108410 -23.395215 40.0 400.5 -94.448342 0.187325 0.000665 1.822733 -2.005641 -0.483057 -0.185104 -18.978051
392000.5 209.888784 204072.744688 800.0 0.131776 -17.679262 40.0 400.5 -94.404683 0.187393 0.000139 1.820639 -2.009751 -0.482796 -0.184697 -18.964798
396000.5 238.403602 204286.347188 800.0 0.140075 0.952222 40.0 400.5 -93.801894 0.187505 0.001058 1.830544 -2.009674 -0.482872 -0.184972 -18.763616
400000.5 321.055877 214521.868750 800.0 0.136083 -23.540295 40.0 400.5 -93.942884 0.189320 0.000971 1.829790 -2.011245 -0.485025 -0.185287 -18.811383
404000.5 202.083949 211019.176875 800.0 0.120063 -41.328331 40.0 400.5 -94.607919 0.187738 0.001006 1.824316 -2.013222 -0.485388 -0.185184 -19.034323
408000.5 138.512097 216563.620625 800.0 0.152197 -18.446270 40.0 400.5 -94.593475 0.188554 0.000253 1.821491 -2.011557 -0.484752 -0.184696 -19.028558
412000.5 34.515037 208167.654219 800.0 0.144590 -9.956440 40.0 400.5 -94.327922 0.188238 0.000589 1.823128 -2.011543 -0.485977 -0.184822 -18.940479
416000.5 8.198625 220994.370625 800.0 0.122899 -8.377054 40.0 400.5 -94.020780 0.188495 -0.000557 1.817646 -2.013103 -0.486009 -0.184768 -18.838908
420000.5 -102.993905 212710.776719 800.0 0.138414 -5.776745 40.0 400.5 -93.650548 0.189757 0.003217 1.819190 -2.015410 -0.485668 -0.184866 -18.714506
424000.5 -7.671242 210117.102656 800.0 0.156452 9.150613 40.0 400.5 -92.861258 0.189651 0.000655 1.817318 -2.013035 -0.486136 -0.184759 -18.451628

106 rows × 15 columns

In [83]:
df['reward'].plot(style='.', title='reward')
df['Reward'].plot(style='.', title='Reward')
Out [83]:
<matplotlib.axes._subplots.AxesSubplot at 0x7ffa1e391c18>
In [84]:
df['head_height_reward'].plot(style='.', title='head height reward')
Out [84]:
<matplotlib.axes._subplots.AxesSubplot at 0x7ffa1db2f588>
In [81]:
for col in df.columns:
    df[col].plot(style='.', title=col)
    plt.show()
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: