1717package org .deeplearning4j .examples .rl4j ;
1818
1919import java .io .IOException ;
20+
2021import org .deeplearning4j .rl4j .learning .HistoryProcessor ;
2122import org .deeplearning4j .rl4j .learning .sync .qlearning .QLearning ;
2223import org .deeplearning4j .rl4j .learning .sync .qlearning .discrete .QLearningDiscreteConv ;
2627
2728/**
2829 * @author saudet
29- *
30+ * <p>
3031 * Main example for DQN with The Arcade Learning Environment (ALE)
31- *
3232 */
3333public class ALE {
3434
3535 public static HistoryProcessor .Configuration ALE_HP =
36- new HistoryProcessor .Configuration (
37- 4 , //History length
38- 84 , //resize width
39- 110 , //resize height
40- 84 , //crop width
41- 84 , //crop height
42- 0 , //cropping x offset
43- 0 , //cropping y offset
44- 4 //skip mod (one frame is picked every x
45- );
36+ new HistoryProcessor .Configuration (
37+ 4 , //History length
38+ 152 , //resize width
39+ 194 , //resize height
40+ 152 , //crop width
41+ 194 , //crop height
42+ 8 , //cropping x offset
43+ 32 , //cropping y offset
44+ 4 //skip mod (one frame is picked every x
45+ );
4646
4747 public static QLearning .QLConfiguration ALE_QL =
48- new QLearning .QLConfiguration (
49- 123 , //Random seed
50- 10000 , //Max step By epoch
51- 8000000 , //Max step
52- 1000000 , //Max size of experience replay
53- 32 , //size of batches
54- 10000 , //target update (hard)
55- 500 , //num step noop warmup
56- 0.1 , //reward scaling
57- 0.99 , //gamma
58- 100.0 , //td-error clipping
59- 0.1f , //min epsilon
60- 100000 , //num step for eps greedy anneal
61- true //double-dqn
62- );
48+ new QLearning .QLConfiguration (
49+ 123 , //Random seed
50+ 10000 , //Max step By epoch
51+ 8000000 , //Max step
52+ 1000000 , //Max size of experience replay
53+ 32 , //size of batches
54+ 10000 , //target update (hard)
55+ 500 , //num step noop warmup
56+ 0.1 , //reward scaling
57+ 0.99 , //gamma
58+ 100.0 , //td-error clipping
59+ 0.1f , //min epsilon
60+ 100000 , //num step for eps greedy anneal
61+ true //double-dqn
62+ );
6363
6464 public static DQNFactoryStdConv .Configuration ALE_NET_QL =
65- new DQNFactoryStdConv .Configuration (
66- 0.00025 , //learning rate
67- 0.000 , //l2 regularization
68- null , null
69- );
65+ new DQNFactoryStdConv .Configuration (
66+ 0.00025 , //learning rate
67+ 0.000 , //l2 regularization
68+ null , null
69+ );
7070
7171 public static void main (String [] args ) throws IOException {
7272
@@ -76,7 +76,7 @@ public static void main(String[] args) throws IOException {
7676 //setup the emulation environment through ALE, you will need a ROM file
7777 ALEMDP mdp = null ;
7878 try {
79- mdp = new ALEMDP ("pong.bin" );
79+ mdp = new ALEMDP ("/home/bam4d/konduit/ALE/ROMS/ pong.bin" );
8080 } catch (UnsatisfiedLinkError e ) {
8181 System .out .println ("To run this example, uncomment the \" ale-platform\" dependency in the pom.xml file." );
8282 }
0 commit comments