                                  Safety-Polarized and Prioritized Reinforcement Learning





                                    Table 2. Hyperparameters for all DQN-based algorithms



                        Algorithm               Parameter                            Value

                                                optimizer                            Adam

                                                discount factor                      0.99

                                                Q-network learning rate              5 · 10−4

                                                batch size                           64

                        Shared                  update every                         1

                                                initial ϵ-greedy exploration rate    1

                                                ϵ decay                              0.995

                                                ϵ min                                0.01

                                                number of random seeds               6

                                                SA-REF ψ learning rate               5 · 10−4

                        SPOM (ours)

                                                polarization function                fpol (x) = 10 log(x)

                                                priority exponent α                  0.6

                        SPOM PER (ours)

                                                importance sampling exponent θ       0.4

                                                safety critic Qrisk learning rate    5 · 10−4

                        SafeQ and Recovery      εrisk                                0.1

                                                γrisk                                0.99

                        RCDQN                   Lagrange multiplier learning rate    0.001

                        RewsDQN                 shaped crash reward                  −10





                                      Table 3. Hyperparameters for PPO-based algorithms



                                    Algorithm   Parameter                            Value

                                                optimizer                            Adam

                                                discount factor                      0.99

                                    Shared      learning rates of actor and critic   3 · 10−4

                                                GAE parameter                        0.97

                                                clip ratio                           0.2

                                                REF learning rate                    1 · 10−4

                                    RESPO

                                                Lagrange multiplier learning rate    5 · 10−5

                                    PPOLag      Lagrange multiplier learning rate    0.001





    s = (x, y, ẋ, ẏ), where (x, y) is the xy-coordinate of the agent, ẋ and ẏ are the speeds at x-direction and y-

    direction respectively. The action space consists of one idle action and the following eight directions for acceleration:

    (cos(kπ/4), sin(kπ/4)), k = 0, 1, . . . , 7. After choosing an action a, the corresponding acceleration vector is aconst · a,

    where aconst > 0 is a constant acceleration scalar. The maximal episode length is 100. The rewards encourage circular

    movement of radius R∗ and the unsafe state set Su restricts agent to stay inside the region |x| ≤ xmax :



                                           Su = {s = (x, y, ẋ, ẏ) ∈ S | |x| ≤ xmax },

                                                      (ẋ, ẏ) · (−y, x)

                                                

                                                                           , if s ∈ / Su ,

                                       r(s, a) = 1 + | ∥(x, y)∥2 − R∗ |

                                                

                                                   − 1,                         otherwise.

     For our experiments, we take aconst = 1, xmax = 2.5 and R∗ = 5.





C.2. Algorithms

C.2.1. I MPLEMENTATION

The original SafeQ (Srinivasan et al., 2020) and Recovery RL (Thananjeyan et al., 2020) are based on actor-critic frameworks.

Here we give detailed descriptions on their adaption to the DQN implementations.



                                                               18

