implement MaxPooling1D/AveragePooling1D, with tests

This commit is contained in:
Leon Chen committed 2016-08-31 17:00:51 -04:00
1 parent 18170ac11a
commit 30d045339a
15 files changed
+1445 -7

No files matched your search

+2 -2
View File
@@ -143,8 +143,8 @@ export default class Convolution2D extends Layer {
let patch = new Tensor([], [patchLen])
let n = 0
for (let i = 0; i <= inputRows - nbRow; i += this.subsample[0]) {
for (let j = 0; j <= inputCols - nbCol; j += this.subsample[1]) {
for (let i = 0, limit = inputRows - nbRow; i <= limit; i += this.subsample[0]) {
for (let j = 0, limit = inputCols - nbCol; j <= limit; j += this.subsample[1]) {
const patchData = flattenDeep(unpack(
x.tensor.hi(i + nbRow, j + nbCol, inputChannels).lo(i, j, 0)
))