I'm trying to use convnetjs to classify 320x240 grayscale image as Rock/Paper/Scissors/Unknown. Here is how I constructed the model
var layer_defs = [];
// input layer (all volumes are 3D)
layer_defs.push({type:'input', out_sx:320, out_sy:240, out_depth:1});
// output of below layer will be 160x120x8
layer_defs.push({type:'conv', sx:5, filters:8, stride:2, pad:2, activation:'relu'});
// output of below layer will be 80x60x8
layer_defs.push({type:'pool', sx:2, stride:2});
// output of below layer will be 40x30x8
layer_defs.push({type:'conv', sx:5, filters:8, stride:2, pad:2, activation:'sigmoid'});
// output of below layer will be 20x15x8
layer_defs.push({type:'pool', sx:2, stride:2});
// a softmax classifier predicting probabilities for four classes: 0,1,2,3
layer_defs.push({type:'softmax', num_classes:4});
this.model = new convnetjs.Net();
this.model.makeLayers(layer_defs);
this.trainer = new convnetjs.Trainer(this.model, {
l2_decay:0.001,
learning_rate: 0.02,
});
After I train the model for ~100 examples, when I use the model to predict, no matter what image I give, the prediction weights are the same. Anyone know what is wrong with my model?