MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / encoder

Method encoder

examples/GAN/BEGAN.py:55–75  ·  view source on GitHub ↗
(self, imgs)

Source from the content-addressed store, hash-verified

53
54 @auto_reuse_variable_scope
55 def encoder(self, imgs):
56 with argscope(Conv2D, activation=tf.nn.elu, kernel_size=3, strides=1):
57 l = (LinearWrap(imgs)
58 .Conv2D('conv1.1', NF)
59 .Conv2D('conv1.2', NF)
60 .Conv2D('conv1.3', NF * 2)
61 .AvgPooling('pool1', 2)
62 # 32
63 .Conv2D('conv2.1', NF * 2)
64 .Conv2D('conv2.2', NF * 3)
65 .AvgPooling('pool2', 2)
66 # 16
67 .Conv2D('conv3.1', NF * 3)
68 .Conv2D('conv3.2', NF * 4)
69 .AvgPooling('pool3', 2)
70 # 8
71 .Conv2D('conv4.1', NF * 4)
72 .Conv2D('conv4.2', NF * 4)
73
74 .FullyConnected('fc', NH)())
75 return l
76
77 def build_graph(self, image_pos):
78 image_pos = image_pos / 128.0 - 1

Callers 1

build_graphMethod · 0.95

Calls 2

argscopeFunction · 0.85
LinearWrapClass · 0.85

Tested by

no test coverage detected