-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Saving prediction results on cikm contest data #238
Saving prediction results on cikm contest data #238
Conversation
DavdGao
commented
Jul 15, 2022
•
edited
Loading
edited
- This PR is a temporary solution to save prediction results on the cikmcup dataset.
- It will be updated soon.
- It should be merged after the PR Some modification for CIKMCUP #227
def save_prediction(self, client_id, task_type): | ||
y_inds, y_probs = self.ctx.test_y_inds, self.ctx.test_y_prob | ||
if 'classification' in task_type: | ||
y_probs = np.argmax(y_probs, axis=-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y_preds = np.argmax(y_probs, axis=-1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified accordingly
@@ -69,6 +84,21 @@ def _hook_on_batch_forward_flop_count(self, ctx): | |||
self.ctx.monitor.total_flops += self.ctx.monitor.flops_per_sample * \ | |||
ctx.batch_size | |||
|
|||
def save_prediction(self, client_id, task_type): | |||
y_inds, y_probs = self.ctx.test_y_inds, self.ctx.test_y_prob | |||
os.makedirs('../prediction', exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is "../" necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM