Skip to content

Commit

Permalink
Fix a critical bug
Browse files Browse the repository at this point in the history
Fix a critical bug at generating inputs. It’s difficult to locate.
  • Loading branch information
suquark committed Jan 27, 2017
1 parent 4148d88 commit d355661
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RL/deepqlearn.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ class DQN {
var n = this.window_size;
for (let k = 0; k < this.temporal_window; k++) {
let state = this.state_window[n - 1 - k];
let action = this.action_window[n - 1 - k];
// state
w = w.concat(state);
// action, encoded as 1-of-k indicator vector. We scale it up a bit because
// we dont want weight regularization to undervalue this information, as it only exists once
let action1ofk = one_hot(this.num_actions, state, 1.0 * this.num_states);
let action1ofk = one_hot(this.num_actions, action, 1.0 * this.num_states);
w = w.concat(action1ofk);
}
return w;
Expand Down
2 changes: 1 addition & 1 deletion test_rl.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
startlearn();
goveryfast();

$.getJSON("RL/helper/saving2.json", function(json) {
$.getJSON("RL/helper/saving.json", function(json) {
w.agent.brain.value_net.fromJSON(json);
stoplearn();
gonormal();
Expand Down

0 comments on commit d355661

Please sign in to comment.