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

After training, How to test on my test set?? #101

Open
snlpatel001213 opened this issue Mar 20, 2018 · 0 comments
Open

After training, How to test on my test set?? #101

snlpatel001213 opened this issue Mar 20, 2018 · 0 comments

Comments

@snlpatel001213
Copy link

var net; // declared outside -> global variable in window scope
function start() {
var layer_defs = [];
// input layer of size 1x1x2 (all volumes are 3D)
layer_defs.push({type:'input', out_sx:1, out_sy:1, out_depth:2});
// some fully connected layers
layer_defs.push({type:'fc', num_neurons:20, activation:'relu'});
layer_defs.push({type:'fc', num_neurons:20, activation:'relu'});
// a softmax classifier predicting probabilities for two classes: 0,1
layer_defs.push({type:'softmax', num_classes:2});

// create a net out of it
var net = new convnetjs.Net();
net.makeLayers(layer_defs);

// the network always works on Vol() elements. These are essentially
// simple wrappers around lists, but also contain gradients and dimensions
// line below will create a 1x1x2 volume and fill it with 0.5 and -1.3
var x = new convnetjs.Vol([0.5, -1.3],[0.5, -1.3]);
var x = new convnetjs.Vol([0],[1]);

var probability_volume = net.forward(x);
console.log('probability that x is class 0: ' + probability_volume.w);
// prints 0.50101

var trainer = new convnetjs.Trainer(net, {learning_rate:0.01, l2_decay:0.001});
trainer.train(x, [[0],[1]]);

?????????????????????????????????????????/

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

No branches or pull requests

1 participant