(self, inputs)
| 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 |
nothing calls this directly
no test coverage detected