j6
Version:
Javascript scientific library (like R, NumPy, Matlab)
47 lines (39 loc) • 823 B
JavaScript
/**
* Created by joonkukang on 2014. 1. 15..
*/
var j6 = require('../../lib/j6')
j6.precision = 4
var startTime = new Date()
var x = [
[],
[],
[],
[],
[],
[]]
var y = [
[],
[],
[],
[],
[],
[]]
var mlp = new j6.NN.MLP({
'input': x,
'label': y,
'nIns': 6,
'nOuts': 2,
'hiddenLayerSizes': [4, 4, 5]
})
// mlp.set('log level',1);
mlp.train({
'lr': 0.6,
'epochs': 20000
})
var a = [
[],
[],
[]]
console.log(mlp.predict(a))
var stopTime = new Date()
console.log('millseconds=', stopTime - startTime)