1

I'm trying to make some simple nn using ml5js. I have a bunch of data in json format, 16 inputs (numbers from 0 to 15), and 1 output (numbers from 1 to 4) https://raw.githubusercontent.com/dphdmn/aiTest/main/9473_moves_data.json

Then i am making a model and load the data:

let model;
let options = {
    inputs: 16,
    outputs: 1,
    task: 'classification',
    debug: 'true'
  };
model = ml5.neuralNetwork(options);
//loading my data
model.loadData('9473_moves_data.json', modelLoaded);

Then i am trying to train the model, but failing:

function modelLoaded(){
    console.log(model.data); //it shows the data successfully, so it is loaded!
    console.log('starting training');
    model.normalizeData(); //normalazing data to 0..1
    let options = {
      epochs: 20
    }//start training
    model.train(options, whileTraining, finishedTraining); 
}
//train log
function whileTraining(epoch, loss) {
  console.log(epoch);
}
function finishedTraining() {
  console.log('finished training.');
}

If i use task: 'classification', it just does nothing while training, and output is just "starting training", "finished training", like there was no training at all!

If i change task to 'regression", it starts working, but not very promising, it just stuck at 0.14 loss value, and after that, for any array example it gives the prediction "2", even on the training data.

dphdmn
  • 21
  • 2

0 Answers0