(self,
parse_input_fn,
target_encoder_fn,
context_encoder_fn,
pos_sample_fn,
neg_sample_fn,
logit_fn=PosNegLogits(),
metric_name='auc',
metric_fn=None,
loss_fn=xent_loss)
| 74 | |
| 75 | class UnsuperviseSampleSolution(object): |
| 76 | def __init__(self, |
| 77 | parse_input_fn, |
| 78 | target_encoder_fn, |
| 79 | context_encoder_fn, |
| 80 | pos_sample_fn, |
| 81 | neg_sample_fn, |
| 82 | logit_fn=PosNegLogits(), |
| 83 | metric_name='auc', |
| 84 | metric_fn=None, |
| 85 | loss_fn=xent_loss): |
| 86 | self.parse_input_fn = parse_input_fn |
| 87 | self.metric_name = metric_name |
| 88 | if metric_fn is None: |
| 89 | self.metric_fn = tf_euler.utils.metrics.get(metric_name) |
| 90 | else: |
| 91 | self.metric_fn = metric_fn |
| 92 | self.target_encoder = target_encoder_fn |
| 93 | self.context_encoder = context_encoder_fn |
| 94 | self.pos_sample_fn = pos_sample_fn |
| 95 | self.neg_sample_fn = neg_sample_fn |
| 96 | self.logit_fn = logit_fn |
| 97 | self.loss_fn = loss_fn |
| 98 | |
| 99 | def target_embed(self, n_id): |
| 100 | emb = self.target_encoder(n_id) |
nothing calls this directly
no test coverage detected