I'm trying to recreate a readable version of the mnist demo. My implementation uses a 28x28 array to forward into the network with the same layer defs:
I don't know how to train the network properly using the Vol class. Whatever I do the network just does not learn and the cost error is always NaN. The forward pass works fine though but the trainer.train does not.
My train function is as follows
function train(data){
if (stopTraining){return}
let cop = [...data.input]
cop.reshape(28, 28)
cop = transposeArray(cop, cop.length)
let x = new convnetjs.Vol(cop.length, cop[0].length, 1, 0.0)
x.w = cop.flat()
let stats = trainer.train(x, data.output)
console.log(stats)
}
I'm trying to recreate a readable version of the mnist demo. My implementation uses a 28x28 array to forward into the network with the same layer defs:
I don't know how to train the network properly using the Vol class. Whatever I do the network just does not learn and the cost error is always NaN. The forward pass works fine though but the trainer.train does not.
My train function is as follows