MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / forward

Method forward

tensorlayer/layers/dense/ternary_dense.py:94–108  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

92 self.b = self._get_weights(var_name="biases", shape=(self.n_units), init=self.b_init)
93
94 def forward(self, inputs):
95 # W = tl.act.sign(W) # dont update ...
96 alpha = compute_alpha(self.W)
97 W_ = ternary_operation(self.W)
98 W_ = tf.multiply(alpha, W_)
99 # W = tf.Variable(W)
100
101 outputs = tf.matmul(inputs, W_)
102 # self.outputs = xnor_gemm(self.inputs, W) # TODO
103
104 if self.b_init is not None:
105 outputs = tf.nn.bias_add(outputs, self.b, name='bias_add')
106 if self.act:
107 outputs = self.act(outputs)
108 return outputs

Callers

nothing calls this directly

Calls 2

compute_alphaFunction · 0.90
ternary_operationFunction · 0.90

Tested by

no test coverage detected