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
@@ -69,7 +69,7 @@ describe('convolutional layer: Deconvolution2D', function () {
it(title, function () {
console.log(`\n%c${title}`, styles.h3)
let testLayer = new layers.Deconvolution2D(nbFilter, nbRow, nbCol, outputShape, attrs)
let testLayer = new layers.Deconvolution2D(Object.assign({ nbFilter, nbRow, nbCol, outputShape }, 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))
@@ -104,7 +104,7 @@ describe('convolutional layer: Deconvolution2D', function () {
it(title, function () {
console.log(`\n%c${title}`, styles.h3)
let testLayer = new layers.Deconvolution2D(nbFilter, nbRow, nbCol, outputShape, attrs)
let testLayer = new layers.Deconvolution2D(Object.assign({ nbFilter, nbRow, nbCol, outputShape }, 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))