mirror of
https://github.com/wassname/keras-js.git
synced 2026-09-11 12:20:53 +08:00
move all layer params into attrs object
This commit is contained in:
@@ -15,12 +15,12 @@ describe('core layer: Dropout', function () {
|
||||
it('[core.Dropout.0] should just pass through tensor during test time', function () {
|
||||
const key = 'core.Dropout.0'
|
||||
console.log(`\n%c[${key}] should pass through`, styles.h3)
|
||||
let testLayer1 = new layers.Dense(2)
|
||||
let testLayer1 = new layers.Dense({ outputDim: 2 })
|
||||
testLayer1.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)
|
||||
t = testLayer1.call(t)
|
||||
console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
|
||||
let testLayer2 = new layers.Dropout(0.5)
|
||||
let testLayer2 = new layers.Dropout({ p: 0.5 })
|
||||
const startTime = performance.now()
|
||||
t = testLayer2.call(t)
|
||||
const endTime = performance.now()
|
||||
|
||||
Reference in New Issue
Block a user