move all layer params into attrs object

This commit is contained in:
Leon Chen
2016-09-18 23:20:59 -04:00
parent b1af2a7751
commit fd20f1b7b1
47 changed files with 285 additions and 162 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ describe('convolutional layer: Convolution2D', function () {
it(title, function () {
console.log(`\n%c${title}`, styles.h3)
let testLayer = new layers.Convolution2D(nbFilter, nbRow, nbCol, attrs)
let testLayer = new layers.Convolution2D(Object.assign({ nbFilter, nbRow, nbCol }, attrs))
testLayer.setWeights(TEST_DATA[key].weights.map(w => new KerasJS.Tensor(w.data, w.shape)))
let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
@@ -101,7 +101,7 @@ describe('convolutional layer: Convolution2D', function () {
it(title, function () {
console.log(`\n%c${title}`, styles.h3)
let testLayer = new layers.Convolution2D(nbFilter, nbRow, nbCol, attrs)
let testLayer = new layers.Convolution2D(Object.assign({ nbFilter, nbRow, nbCol }, attrs))
testLayer.setWeights(TEST_DATA[key].weights.map(w => new KerasJS.Tensor(w.data, w.shape)))
let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape, { useWeblas: true })
console.log('%cin', styles.h4, stringifyCondensed(t.tensor))