Skip to main content
. 2019 Apr 1;19(7):1576. doi: 10.3390/s19071576
Algorithm 1 Hierarchical Reinforcement Learning
  •  1:

    Initialize experience replay memories {DH,DL} and the exploration probability ϵH=1 and ϵL=1 for the high-level and low-level policies, respectively.

  •  2:

    Initialize parameters θH,θL for the online networks and θH,θL for the target networks.

  •  3:

    For i = 1, num_episodes do

  •  4:

     Initialize the navigation and get the start state s.

  •  5:

     While s is not teriminal do

  •  6:

      R0

  •  7:

      s0s

  •  8:

      With probability ϵH select a random subgoal g from the PC-GWR nodes

  •  9:

      Otherwise select g=maxgQH(s,g;θH)

  • 10:

      while not (s is terminal or goal g is reached) do

  • 11:

       With probability ϵL select a random action a

  • 12:

       Otherwise select a=maxaQL(s,g,a;θL)

  • 13:

       Execute a and obtain the next state s and extrinsic reward re from the environment

  • 14:

       Obtain the intrinsic reward ri

  • 15:

       Store transition ({s,g},a,ri,{s,g}) in DL

  • 16:

       Sample random mini-batches from DL

  • 17:

       Update θL according to Equation (7)

  • 18:

       RR+re

  • 19:

       ss

  • 20:

      end while

  • 21:

      Store transition (s0,g,R,s) in DL

  • 22:

      Sample random mini-batches from DH

  • 23:

      Update θH according to Equation (6)

  • 24:

      Every C steps copy θH to θH and θL to θL

  • 25:

     end while

  • 26:

     Anneal ϵH and ϵL adaptively

  • 27:

    end for