Skip to content

Transfer Learning Library for Domain Adaptation and Finetune.

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

wuaodi/Transfer-Learning-Library

This branch is 22 commits ahead of, 476 commits behind thuml/Transfer-Learning-Library:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

29a9461 · May 8, 2021
Apr 19, 2021
Apr 3, 2021
Mar 21, 2021
May 6, 2021
Apr 3, 2021
Mar 21, 2021
Mar 18, 2020
Apr 14, 2020
May 8, 2021
Mar 8, 2021
Mar 22, 2021
Mar 22, 2021

Repository files navigation

colab地址

原readme文档

说明

本仓库代码用自己的数据集训练迁移学习模型,基于清华迁移学习库dalib编写实现

cdcn_wad.py除了输出模型参数,还增加了输出网络结构和参数,保存在checkpoints的best_all.pth

Q&A

如何分析DANN方法初始数据的分布?

答:TSNE图,源域是蓝色,目标域是红色

注释掉 /content/Transfer-Learning-Library/examples/domain_adaptation/classification/damm_wad.py以下几行:

# resume from the best checkpoint
if args.phase != 'train':
    checkpoint = torch.load(logger.get_checkpoint_path('best'), map_location='cpu')
    classifier.load_state_dict(checkpoint)

然后直接执行:

# DANN分析自己数据集
%cd /content/Transfer-Learning-Library/examples/domain_adaptation/classification
!CUDA_VISIBLE_DEVICES=0 python dann_wad.py data/MRSSC -d MRSSC -s V -t I -v T -a resnet50 --epochs 10 --seed 1 --log logs/dann/MRSSC_V2I --phase analysis

如果要是看数据经过训练后的网络的t-SNE图,就不用注释,先执行训练命令,再执行分析命令就好了

怎么输出混淆矩阵?

答:测试命令行加参数 '--per-class-eval'

About

Transfer Learning Library for Domain Adaptation and Finetune.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%