forked from prl-mushr/mushr_rhc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:rogeriobonatti/mushr_rhc
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
# file_path = '/home/azureuser/hackathon_data/e2e_eval/GPTiros_e2e_8gpu_2022-02-17_v2/info.csv' | ||
file_path = '/home/azureuser/hackathon_data/e2e_eval/model_test/info.csv' | ||
data = np.genfromtxt(file_path, delimiter=',') | ||
|
||
distances = data[:,0] | ||
times = data[:,1] | ||
|
||
# clear data that crashes immediately | ||
min_time = 3.0 | ||
distances = distances[times>min_time] | ||
times = times[times>min_time] | ||
|
||
plt.hist(distances, bins=30, facecolor='green', alpha=0.75) | ||
# plt.savefig('/home/azureuser/hackathon_data/e2e_eval/GPTiros_e2e_8gpu_2022-02-17_v2/fig.png') | ||
plt.savefig('/home/azureuser/hackathon_data/e2e_eval/model_test/fig.png') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# from torchsummary import summary | ||
import sys | ||
import os | ||
import signal | ||
import threading | ||
import random | ||
import numpy as np | ||
from queue import Queue | ||
import time | ||
from collections import OrderedDict | ||
import matplotlib.pyplot as plt | ||
|
||
num_samples = 10000 | ||
results = np.zeros(shape=(num_samples,)) | ||
|
||
max_seq_length = 100 | ||
for i in range(num_samples): | ||
episode_path_length = 0.0 | ||
iter = 0 | ||
while iter < max_seq_length: | ||
result = np.random.random() < 0.99 | ||
if result: | ||
episode_path_length+= 1.0 | ||
else: | ||
break | ||
iter += 1 | ||
results[i] = episode_path_length | ||
|
||
plt.hist(results, bins=30, facecolor='green', alpha=0.75) |