In [4]:
# include necessary packages
using HDF5
using JLD
using PolicyViz

#Load Q data
#Uncomment if you want to load Q data
q = h5open("/home/sisl/kyle/notebooks/Reshaped_Q.h5", "r") do file
    read(file, "Q")
end
q = q';

Visualize Regressed ACAS Xu Policies

Inputs:

  • neuralNetworkPath - path to the .nnet file you want to visualize
  • q - data for the score table. This input is optional

Outputs: Interactive Plots

Interactive Settings:
  • psi_int: Intruder relative heading angle
  • v_own: Ownship speed
  • v_int: Intruder speed
  • tau: Time to minimum vertical separation
  • pa: Previous advisory. Note that these are indices to the advisory array: [0.0, 1.5, -1.5, 3.0, -3.0]
  • zoom: A zoom scaling factor used in plotting. 4 is most zoomed in, while 1 has no zoom
  • nbin: The number of bins being plotted. Higher nbin means better resolution, but that takes longer to compute
  • Interp: Boolean, true means the score table is interpolated at each point, false means it uses nearest neighbor
  • Belief: Boolean, true means the Q values at each point are averaged between the given point and neighboring points +/- a standard deviation in R, Theta, Intruder Heading, and Intrudedr Speed. The remaining inputs only matter when Belief is true
  • beliefProb: Probability of nominal state. The remaining probability is divided equally among the 8 other points
  • deltaR: Standard Deviation in Range. The first option is standard, but other options are included as well
  • deltaTh: Standared deviation in bearing to intruder relative to ownship heading.
  • deltaPsi: Standard deviation in intruder heading relative to ownship heading
  • deltaV: Standard deviation in intruder velocity
  • worst: If this is set to true, then the Q-values are not averaged, but rather the set of Q values with the worst optimal action is chosen.

In [5]:
#ACAS Xu Regression
neuralNetworkPath = "/home/sisl/kyle/data/nnet/ACASXU_ADAMAX_customLoss_900_norm.nnet"
viz_policy(q,neuralNetworkPath)


Out[5]:

Visualize Deep RL ACAS Xu Policies

Inputs:

  • neuralNetworkPath - path to the .nnet file you want to visualize
  • q - data for the score table. This input is optional

Outputs: Interactive Plots

Interactive Settings:
  • psi_int: Intruder relative heading angle
  • v_own: Ownship speed
  • v_int: Intruder speed
  • zoom: A zoom scaling factor used in plotting. 4 is most zoomed in, while 1 has no zoom
  • nbin: The number of bins being plotted. Higher nbin means better resolution, but that takes longer to compute
  • interp: Boolean, true means the score table is interpolated at each point, false means it uses nearest neighbor

In [7]:
#Deep RL compared to polar Discrete Value Iteration
neuralNetworkPath = "/home/sisl/kyle/data/nnet/DRL_ReducedPen_AlwaysExplore_TriangleRewards_74000.nnet"
solQ = load("../../coord/src/MDP_ReducedPenConflict_radialPoints_More_fine.jld", "solQ")
solQ = solQ'
viz_policy_drl(neuralNetworkPath,solQ)


Out[7]:

In [ ]: