Skip to content

Commit

Permalink
Adding graph of feasible iterations of the MPSF
Browse files Browse the repository at this point in the history
  • Loading branch information
pizarrob committed Sep 28, 2023
1 parent aac70a3 commit e655401
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 5 deletions.
14 changes: 14 additions & 0 deletions experiments/mpsc/plotting_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,19 @@ def extract_number_of_corrections(results_data):
return num_corrections


def extract_feasible_iterations(results_data):
'''Extracts the number of feasible iterations from an experiment's data.
Args:
results_data (dict): A dictionary containing all the data from the desired experiment.
Returns:
feasible_iterations (list): The list of the number of feasible iterations for all experiments.
'''
feasible_iterations = [np.sum(mpsc_results['feasible'][0]) for mpsc_results in results_data['cert_results']['safety_filter_data']]
return feasible_iterations


def extract_rmse(results_data, certified=True):
'''Extracts the RMSEs from an experiment's data.
Expand Down Expand Up @@ -932,6 +945,7 @@ def extract_length_uncert(results_data, certified=False): return extract_length(
plot_model_comparisons(system_name, task_name, algo_name, extract_reward_uncert)
plot_model_comparisons(system_name, task_name, algo_name, extract_failed_cert)
plot_model_comparisons(system_name, task_name, algo_name, extract_failed_uncert)
plot_model_comparisons(system_name, task_name, algo_name, extract_feasible_iterations)
if task_name == 'stab':
plot_model_comparisons(system_name, task_name, algo_name, extract_final_dist_cert)
plot_model_comparisons(system_name, task_name, algo_name, extract_final_dist_uncert)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions experiments/mpsc/train_model.sbatch
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
#SBATCH --job-name=safe_control_gym_train_rl_%j
#SBATCH --output=/h/pizarrob/safe-control-gym/experiments/mpsc/temp-data/mpsf_reset_%j.out
#SBATCH --error=/h/pizarrob/safe-control-gym/experiments/mpsc/temp-data/mpsf_reset_%j.err
#SBATCH --open-mode=append
#SBATCH --partition=cpu,gpu,wsgpu
#SBATCH --ntasks=1
#SBATCH --partition=t4v2,rtx6000,a40
#SBATCH -t 0-12:00
#SBATCH --cpus-per-task=1
#SBATCH --mem=16G
#SBATCH --gres=gpu:0
#SBATCH --nodes=1
#SBATCH --gres=gpu:1
#SBATCH --qos=normal

SYS='cartpole'
Expand Down

0 comments on commit e655401

Please sign in to comment.