Update classifier to included trained neural net

This commit is contained in:
Shaunak Kishore
2015-09-13 00:35:41 -04:00
parent 515014d39a
commit 9f0a69554c
4 changed files with 22 additions and 4 deletions

17
lib/classifier.js Normal file
View File

@ -0,0 +1,17 @@
Meteor.startup(function() {
var weight = 0.8;
var dimensions = 8;
var input = new convnetjs.Vol(1, 1, dimensions);
var net = new convnetjs.Net();
net.fromJSON(TRAINED_NEURAL_NET);
function net_classifier(features) {
input.w = features;
var softmax = net.forward(input).w;
return softmax[1] - softmax[0];
}
this.combined_classifier = function(features) {
return hand_tuned_classifier(features) + weight*net_classifier(features);
}
});