Implementing Deep Q-Networks (DQN) algorithm

Minimal_DQN_in_Mathematica.nb (41.8 KB)

10 Likes

news-congrads-kkluyshnik-02-04-19.jpg – you have earned Featured Contributor Badge 2015-11-02_10-07-11.png
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

I’ve tried running this on a couple of different (powerful) PCs, but failed in each case. It seems to hang part way through the NetTrain evaluation.

1 Like

I get some immediate errors when training, but if I change this line:

<|"Measurement"->Function[N[#BatchData["score"]][[1]]],"Key"->"Score"|>

to this:

<|"Measurement"->Function[N[#BatchData["score"]]],"Key"->"Score"|>

it works.
(and it seems pretty clear from the code above that the “score” is a real number)

However, the trained agent doesn’t seem to do very well on my 2018 MacBook pro.
Twice it hung (although after manually stopping, the agent does pretty well), and once it finished but failed to hold up the cart pole (image attached).

1 Like