Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't use ConvLayers in deepqlearn.js #109

Open
soswow opened this issue Mar 23, 2019 · 1 comment · May be fixed by #110
Open

I can't use ConvLayers in deepqlearn.js #109

soswow opened this issue Mar 23, 2019 · 1 comment · May be fixed by #110

Comments

@soswow
Copy link

soswow commented Mar 23, 2019

There is a problem with this line:

var svol = new convnetjs.Vol(1, 1, this.net_inputs);

the shape of the input vector is basically hardcoded here when given to the network's forward function. Which makes it all break apart in line

if(oy>=0 && oy<V_sy && ox>=0 && ox<V_sx) {

Where we try to check for existence of those dimensions.

@soswow
Copy link
Author

soswow commented Mar 24, 2019

My current workaround is to do this:

deepqlearn.Brain.prototype.policy = function(s) {
  const svol_sx =  this.value_net.layers[0].out_sx;
  const svol_sy =  this.value_net.layers[0].out_sy;
  const svol_depth =  this.value_net.layers[0].out_depth;
  var svol = new convnetjs.Vol(svol_sx, svol_sy, svol_depth);
  svol.w = s;
  var action_values = this.value_net.forward(svol);
  var maxk = 0;
  var maxval = action_values.w[0];
  for(var k=1;k<this.num_actions;k++) {
    if(action_values.w[k] > maxval) { maxk = k; maxval = action_values.w[k]; }
  }
  return {action:maxk, value:maxval};
};```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant