Skip to content

Instantly share code, notes, and snippets.

View lime-j's full-sized avatar
🎯
Focusing

Mingjia Li lime-j

🎯
Focusing
View GitHub Profile
Namespace(batch_size=8, nepoch=2000, train_workers=8, eval_workers=8, dataset='ISTD', pretrain_weights='./log/model_best.pth', optimizer='adamw', lr_initial=0.0004, weight_decay=0.02, gpu='0', arch='ShadowFormer', mode='shadow', save_dir='./logs/', save_images=False, env='env_name_v2', checkpoint=500, norm_layer='nn.LayerNorm', embed_dim=32, win_size=10, token_projection='linear', token_mlp='leff', att_se=False, vit_dim=320, vit_depth=12, vit_nheads=8, vit_mlp_dim=512, vit_patch_size=16, global_skip=False, local_skip=False, vit_share=False, train_ps=320, resume=False, train_dir='/root/ISTD_Dataset/train/', val_dir='/root/ISTD_Dataset/test/', warmup=True, warmup_epochs=3, boardname=' exp')
RASM(
embed_dim=32, token_projection=linear, token_mlp=leff,win_size=10
(pos_drop): Dropout(p=0.0, inplace=False)
(input_proj): InputProj(
(proj): Sequential(
(0): Conv2d(4, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(1): LeakyReLU(negative_slope=0.01, inplace=True)
)
)
@lime-j
lime-j / pd_esnet.py
Created February 8, 2022 13:21
A modified version of esnet, extracted from PaddleDetection
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@lime-j
lime-j / esnet.py
Created February 8, 2022 13:19
A pytorch version of esnet
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
'''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math