MCPcopy Create free account
hub / github.com/BVLC/caffe / coord_net_spec

Function coord_net_spec

python/caffe/test/test_coord_map.py:12–31  ·  view source on GitHub ↗

Define net spec for simple conv-pool-deconv pattern common to all coordinate mapping tests.

(ks=3, stride=1, pad=0, pool=2, dstride=2, dpad=0)

Source from the content-addressed store, hash-verified

10
11
12def coord_net_spec(ks=3, stride=1, pad=0, pool=2, dstride=2, dpad=0):
13 """
14 Define net spec for simple conv-pool-deconv pattern common to all
15 coordinate mapping tests.
16 """
17 n = caffe.NetSpec()
18 n.data = L.Input(shape=dict(dim=[2, 1, 100, 100]))
19 n.aux = L.Input(shape=dict(dim=[2, 1, 20, 20]))
20 n.conv = L.Convolution(
21 n.data, num_output=10, kernel_size=ks, stride=stride, pad=pad)
22 n.pool = L.Pooling(
23 n.conv, pool=P.Pooling.MAX, kernel_size=pool, stride=pool, pad=0)
24 # for upsampling kernel size is 2x stride
25 try:
26 deconv_ks = [s*2 for s in dstride]
27 except:
28 deconv_ks = dstride*2
29 n.deconv = L.Deconvolution(
30 n.pool, num_output=10, kernel_size=deconv_ks, stride=dstride, pad=dpad)
31 return n
32
33
34class TestCoordMap(unittest.TestCase):

Callers 10

test_conv_pool_deconvMethod · 0.85
test_passMethod · 0.85
test_paddingMethod · 0.85
test_multi_convMethod · 0.85
test_rectMethod · 0.85
test_crop_of_cropMethod · 0.85
test_crop_helperMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected