Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rogeriobonatti/mushr_rhc
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeriobonatti committed Apr 5, 2022
2 parents 53b177a + c445f06 commit 7d44674
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mushr_rhc_ros/src/eval_model.py
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()
29 changes: 29 additions & 0 deletions mushr_rhc_ros/src/test2.py
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)

0 comments on commit 7d44674

Please sign in to comment.