Skip to content

Commit

Permalink
Using AdamW, 1cycle policy. norm per channel. CV: 45.6%, LB: 35.2%
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxbac committed Jul 5, 2019
1 parent 4b58ab1 commit f5b87e5
Show file tree
Hide file tree
Showing 3 changed files with 6 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/se_resnext50_32x4d/
LOGDIR=/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel/se_resnext50_32x4d/
catalyst-dl run \
--config=./configs/${RUN_CONFIG} \
--logdir=$LOGDIR \
Expand Down
4 changes: 2 additions & 2 deletions src/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ def __getitem__(self, idx):

image = load_images_as_tensor(channel_paths, dtype=np.float32)
# image = convert_tensor_to_rgb(image)
image = image / 255
# image = image / 255
if self.transform:
image = self.transform(image=image)['image']

# image = normalize(image, std=std_arr, mean=mean_arr, max_pixel_value=255)
image = normalize(image, std=std_arr, mean=mean_arr, max_pixel_value=255)
image = np.transpose(image, (2, 0, 1)).astype(np.float32)

if self.mode == 'train':
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/se_resnext50_32x4d/"
log_dir = "/raid/bac/kaggle/logs/recursion_cell/test/c123_s1_1cycle_adamw_norm_per_channel/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.csv', index=False, columns=['id_code', 'sirna'])
np.save("./submission/se_resnext50_32x4d_c123_s1_1cycle_adamw.npy", pred)
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)


if __name__ == '__main__':
Expand Down

0 comments on commit f5b87e5

Please sign in to comment.