exp8 版本

This commit is contained in:
bishe 2025-03-07 10:13:25 +08:00
parent 2a0a56ac26
commit 76fcec26e8
3 changed files with 46 additions and 24 deletions

View File

@ -305,19 +305,6 @@ class RomaUnsbModel(BaseModel):
initialized at the first feedforward pass with some input images.
Please also see PatchSampleF.create_mlp(), which is called at the first forward() call.
"""
#bs_per_gpu = data["A"].size(0) // max(len(self.opt.gpu_ids), 1)
#self.set_input(data)
#self.real_A = self.real_A[:bs_per_gpu]
#self.real_B = self.real_B[:bs_per_gpu]
#self.forward() # compute fake images: G(A)
#if self.opt.isTrain:
#
# self.compute_G_loss().backward()
# self.compute_D_loss().backward()
# self.compute_E_loss().backward()
# if self.opt.lambda_NCE > 0.0:
# self.optimizer_F = torch.optim.Adam(self.netF.parameters(), lr=self.opt.lr, betas=(self.opt.beta1, self.opt.beta2))
# self.optimizers.append(self.optimizer_F)
pass
def optimize_parameters(self):

View File

@ -7,27 +7,29 @@
python train.py \
--dataroot /home/openxs/kunyu/datasets/InfraredCity-Lite/Double/Moitor \
--name UNIV_1 \
--name UNIV_5 \
--dataset_mode unaligned_double \
--no_flip \
--display_env UNIV \
--model roma_unsb \
--lambda_GAN 2.0 \
--lambda_SB 1.0 \
--lambda_ctn 1.0 \
--lambda_ctn 10 \
--lambda_inc 1.0 \
--lr 0.00001 \
--gpu_id 0 \
--lambda_D_ViT 1 \
--lambda_global 6.0 \
--gamma_stride 20 \
--lr 0.000002 \
--gpu_id 1 \
--nce_idt False \
--netF mlp_sample \
--flip_equivariance True \
--eta_ratio 0.4 \
--tau 0.01 \
--num_timesteps 4 \
--num_timesteps 5 \
--input_nc 3 \
--n_epochs 400 \
--n_epochs_decay 200 \
# exp1 num_timesteps=4
# exp2 num_timesteps=5
# exp1 num_timesteps=4 (已停)
# exp2 num_timesteps=5 (已停)
# exp3 --num_timesteps 5,--lambda_inc 8 --gamma_stride 20,--lambda_global 6.0,--lambda_ctn 10, --lr 0.000002 (已停)
# exp4 --num_timesteps 5,--lambda_inc 8 --gamma_stride 20,--lambda_global 6.0,--lambda_ctn 10, --lr 0.000002, ET_XY=self.netE(XtXt_1, self.time, XtXt_1).mean() - torch.logsumexp(self.netE(XtXt_1, self.time_idx, XtXt_2).reshape(-1), dim=0) ,并把GAN,CTN loss考虑到了A1和B1 (已停)
# exp5 基于 exp4 ,修改了 self.loss_global = self.calculate_similarity(self.mutil_real_A0_tokens, self.mutil_fake_B0_tokens) + self.calculate_similarity(mutil_real_A1_tokens, self.mutil_fake_B1_tokens) ,gpu_id 1 (已停)
# 上面几个实验效果都不好实验结果都已经删除了开的新的train_sbiv 对代码进行了调整,效果变得更好了。

33
scripts/train_sbiv.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
# Train for video mode
#CUDA_VISIBLE_DEVICES=0 python train.py --dataroot /path --name ROMA_name --dataset_mode unaligned_double --no_flip --local_nums 64 --display_env ROMA_env --model roma --side_length 7 --lambda_spatial 5.0 --lambda_global 5.0 --lambda_motion 1.0 --atten_layers 1,3,5 --lr 0.00001
# Train for image mode
#CUDA_VISIBLE_DEVICES=0 python train.py --dataroot /path --name ROMA_name --dataset_mode unaligned --local_nums 64 --display_env ROMA_env --model roma --side_length 7 --lambda_spatial 5.0 --lambda_global 5.0 --atten_layers 1,3,5 --lr 0.00001
python train.py \
--dataroot /home/openxs/kunyu/datasets/InfraredCity-Lite/Double/Moitor \
--name SBIV_4 \
--dataset_mode unaligned_double \
--display_env SBIV \
--model roma_unsb \
--lambda_SB 1.0 \
--lambda_ctn 10 \
--lambda_inc 1.0 \
--lambda_global 6.0 \
--gamma_stride 20 \
--lr 0.000002 \
--gpu_id 2 \
--nce_idt False \
--netF mlp_sample \
--eta_ratio 0.4 \
--tau 0.01 \
--num_timesteps 3 \
--input_nc 3 \
--n_epochs 400 \
--n_epochs_decay 200 \
# exp6 num_timesteps=4 gpu_id 0基于 exp5 ,exp1 已停) (已停)
# exp7 num_timesteps=3 gpu_id 0 基于 exp6 (将停)
# # exp8 num_timesteps=4 gpu_id 1 ,修改了训练判别器的loss以及ctnloss基于exp6
# # exp9 num_timesteps=3 gpu_id 2 ,(基于 exp8