(self, inputs)
| 33 | raise NotImplementedError |
| 34 | |
| 35 | def __call__(self, inputs): |
| 36 | label, = tf_euler.get_dense_feature(inputs, |
| 37 | [self.label_idx], |
| 38 | [self.label_dim]) |
| 39 | embedding = self.embed(inputs) |
| 40 | logit = self.out_fc(embedding) |
| 41 | |
| 42 | metric = self.metric_class( |
| 43 | label, tf.nn.sigmoid(logit)) |
| 44 | loss = tf.nn.sigmoid_cross_entropy_with_logits( |
| 45 | labels=label, logits=logit) |
| 46 | loss = tf.reduce_mean(loss) |
| 47 | return (embedding, loss, self.metric_name, metric) |
| 48 | |
| 49 | |
| 50 | class UnsuperviseModel(object): |