Skip to content

Instantly share code, notes, and snippets.

@okumura
Created February 24, 2017 12:59
Show Gist options
  • Save okumura/b989e1d6c68762d2614bd0c45d96f150 to your computer and use it in GitHub Desktop.
Save okumura/b989e1d6c68762d2614bd0c45d96f150 to your computer and use it in GitHub Desktop.
get_conv_outsize_2d()
# -*- coding: utf-8 -*-
from chainer.links.connection.convolution_2d import _pair
from chainer.utils.conv import get_conv_outsize
def get_conv_outsize_2d(size, k, s, p=0, cover_all=False, d=1):
sizeh, sizew = _pair(size)
kh, kw = _pair(k)
sh, sw = _pair(s)
ph, pw = _pair(p)
h = get_conv_outsize(sizeh, kh, sh, ph, cover_all, d)
w = get_conv_outsize(sizew, kw, sw, pw, cover_all, d)
return h, w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment