0

Error whenever I call A3CDiscreteDense().train();

Exception in thread "Thread-7" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at org.deeplearning4j.rl4j.learning.async.a3c.discrete.AdvantageActorCriticUpdateAlgorithm.computeGradients(AdvantageActorCriticUpdateAlgorithm.java:63)
    at org.deeplearning4j.rl4j.learning.async.a3c.discrete.AdvantageActorCriticUpdateAlgorithm.computeGradients(AdvantageActorCriticUpdateAlgorithm.java:32)
    at org.deeplearning4j.rl4j.learning.async.AsyncThreadDiscrete.trainSubEpoch(AsyncThreadDiscrete.java:130)
    at org.deeplearning4j.rl4j.learning.async.AsyncThread.handleTraining(AsyncThread.java:192)
    at org.deeplearning4j.rl4j.learning.async.AsyncThread.run(AsyncThread.java:168)

But the same code works fine when I use DQN.

Akash garg
  • 125
  • 6

1 Answers1

0

I had the same issue. It seems that the default learning config would not work, because nStep value should not be 0. Simply call .nStep(5) when creating a learning config from the builder. You can find more info here: https://github.com/eclipse/deeplearning4j-examples/issues/991#issuecomment-823133909

M.Duda
  • 1