Skip to content

Commit a4594ba

Browse files
authored
Merge pull request #975 from KonduitAI/master
Update RL4J examples from dev branch
2 parents 62b13e5 + 5608b54 commit a4594ba

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

rl4j-examples/src/main/java/org/deeplearning4j/examples/rl4j/A3CALE.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
public class A3CALE {
3535

3636
public static HistoryProcessor.Configuration ALE_HP =
37-
new HistoryProcessor.Configuration(
38-
4, //History length
39-
84, //resize width
40-
110, //resize height
41-
84, //crop width
42-
84, //crop height
43-
0, //cropping x offset
44-
0, //cropping y offset
45-
4 //skip mod (one frame is picked every x
46-
);
37+
new HistoryProcessor.Configuration(
38+
4, //History length
39+
84, //resize width
40+
84, //resize height
41+
160, //crop width
42+
194, //crop height
43+
0, //cropping x offset
44+
32, //cropping y offset
45+
4 //skip mod (one frame is picked every x
46+
);
4747

4848
public static A3CDiscrete.A3CConfiguration ALE_A3C =
4949
new A3CDiscrete.A3CConfiguration(

rl4j-examples/src/main/java/org/deeplearning4j/examples/rl4j/ALE.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.deeplearning4j.examples.rl4j;
1818

1919
import java.io.IOException;
20+
2021
import org.deeplearning4j.rl4j.learning.HistoryProcessor;
2122
import org.deeplearning4j.rl4j.learning.sync.qlearning.QLearning;
2223
import org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscreteConv;
@@ -26,47 +27,46 @@
2627

2728
/**
2829
* @author saudet
29-
*
30+
* <p>
3031
* Main example for DQN with The Arcade Learning Environment (ALE)
31-
*
3232
*/
3333
public 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+
84, //resize width
39+
84, //resize height
40+
160, //crop width
41+
194, //crop height
42+
0, //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

0 commit comments

Comments
 (0)