Skip to content

Commit

Permalink
Using smooth label. CV: 48%, LB: 38.5%
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxbac committed Jul 5, 2019
1 parent f5b87e5 commit a49d90e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export CUDA_VISIBLE_DEVICES=2,3
RUN_CONFIG=config.yml


LOGDIR=/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel/se_resnext50_32x4d/
LOGDIR=/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel_smooth/se_resnext50_32x4d/
catalyst-dl run \
--config=./configs/${RUN_CONFIG} \
--logdir=$LOGDIR \
Expand Down
6 changes: 4 additions & 2 deletions configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ stages:
minimize_metric: False

criterion_params:
criterion: CrossEntropyLoss
# criterion: CrossEntropyLoss
criterion: LabelSmoothingCrossEntropy

optimizer_params:
optimizer: AdamW
Expand Down Expand Up @@ -52,7 +53,8 @@ stages:

callbacks_params: &callback_params
loss:
callback: CriterionCallback
# callback: CriterionCallback
callback: LabelSmoothCriterionCallback
optimizer:
callback: OptimizerCallback
accumulation_steps: 2
Expand Down
6 changes: 3 additions & 3 deletions src/make_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def predict(model, loader):
def predict_all():
test_csv = '/raid/data/kaggle/recursion-cellular-image-classification/test.csv'
# test_csv = './csv/valid_0.csv'
log_dir = "/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel/se_resnext50_32x4d/"
log_dir = "/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel_smooth/se_resnext50_32x4d/"
root = "/raid/data/kaggle/recursion-cellular-image-classification/"
site = 1
channels = [1,2,3]
Expand Down Expand Up @@ -75,8 +75,8 @@ def predict_all():
submission = df.copy()
submission['sirna'] = all_preds.astype(int)
os.makedirs("submission", exist_ok=True)
submission.to_csv('./submission/se_resnext50_32x4d_c123_s1_1cycle_adamw_norm_per_channel.csv', index=False, columns=['id_code', 'sirna'])
np.save("./submission/se_resnext50_32x4d_c123_s1_1cycle_adamw_norm_per_channel.npy", pred)
submission.to_csv('./submission/se_resnext50_32x4d_c123_s1_1cycle_adamw_norm_per_channel_smooth.csv', index=False, columns=['id_code', 'sirna'])
np.save("./submission/se_resnext50_32x4d_c123_s1_1cycle_adamw_norm_per_channel_smooth.npy", pred)


if __name__ == '__main__':
Expand Down

0 comments on commit a49d90e

Please sign in to comment.