GithubHelp home page GithubHelp logo

jindongwang / transferlearning Goto Github PK

View Code? Open in Web Editor NEW
12.9K 339.0 3.8K 36.31 MB

Transfer learning / domain adaptation / domain generalization / multi-task learning etc. Papers, codes, datasets, applications, tutorials.-迁移学习

Home Page: http://transferlearning.xyz/

License: MIT License

Python 86.39% MATLAB 4.15% Shell 3.11% Jupyter Notebook 3.50% CMake 0.17% Makefile 1.39% C++ 0.26% Cuda 1.02%
transferlearning domain-adaptation transfer-learning survey deep-learning generalization few-shot tutorial-code theory papers

transferlearning's Introduction

Contributors Forks Stargazers Issues


Transfer Leanring

Everything about Transfer Learning. 迁移学习.

PapersTutorialsResearch areasTheorySurveyCodeDataset & benchmark

ThesisScholarsContestsJournal/conferenceApplicationsOthersContributing

Widely used by top conferences and journals:

@Misc{transferlearning.xyz,
howpublished = {\url{http://transferlearning.xyz}},   
title = {Everything about Transfer Learning and Domain Adapation},  
author = {Wang, Jindong and others}  
}  

Awesome MIT License LICENSE 996.icu

Related Codes:


NOTE: You can directly open the code in Gihub Codespaces on the web to run them without downloading! Also, try github.dev.

0.Papers (论文)

Awesome transfer learning papers (迁移学习文章汇总)

  • Paperweekly: A website to recommend and read paper notes

Latest papers:

Updated at 2024-04-25:

  • MDDD: Manifold-based Domain Adaptation with Dynamic Distribution for Non-Deep Transfer Learning in Cross-subject and Cross-session EEG-based Emotion Recognition [arxiv]

    • Manifold-based domain adaptation for EEG-based emotion recognition 基于流形的DA用于EEG情绪识别
  • Domain Adaptation for Learned Image Compression with Supervised Adapters [arxiv]

    • Domain adaptation for learned image compression DA用于图片压缩
  • Test-Time Training on Graphs with Large Language Models (LLMs) [arxiv]

    • Test-time training on graphs with LLMs 使用大语言模型在图上进行测试时训练

Updated at 2024-04-18:

  • DACAD: Domain Adaptation Contrastive Learning for Anomaly Detection in Multivariate Time Series [arxiv]

    • Domain adaptation for anomaly detection 使用域自适应进行时间序列异常检测
  • CVPR'24 Exploring the Transferability of Visual Prompting for Multimodal Large Language Models [arxiv]

    • Explore the transferability of visual prompting for multimodal LLM 探索多模态大模型visual prompt tuning的可迁移性

Updated at 2024-04-16:

  • DGMamba: Domain Generalization via Generalized State Space Model [arXiv]

    • Domain generalization using mamba 用Mamba结构进行DG
  • CVPR'24 Unified Language-driven Zero-shot Domain Adaptation [arxiv]

    • Language-driven zero-shot domain adaptation 语言驱动的零样本 DA

Updated at 2024-04-01:

  • ICASSP'24 Learning Inference-Time Drift Sensor-Actuator for Domain Generalization [IEEE]

    • Inference-time drift actuator for OOD generalization
  • ICASSP'24 SBM: Smoothness-Based Minimization for Domain Generalization [IEEE]

    • Smoothness-based minimization for OOD generalization
  • ICASSP'24 G2G: Generalized Learning by Cross-Domain Knowledge Transfer for Federated Domain Generalization [IEEE]

    • Federated domain generalization
  • ICASSP'24 Single-Source Domain Generalization in Fundus Image Segmentation Via Moderating and Interpolating Input Space Augmentation [IEEE]

    • Single-source DG in fundus image segmentation
  • ICASSP'24 Style Factorization: Explore Diverse Style Variation for Domain Generalization [IEEE]

    • Style variation for domain generalization
  • ICASSP'24 SPDG-Net: Semantics Preserving Domain Augmentation through Style Interpolation for Multi-Source Domain Generalization [IEEE]

    • Domain augmentation for multi-source DG
  • ICASSP'24 Domaindiff: Boost out-of-Distribution Generalization with Synthetic Data [IEEE]

    • Using synthetic data for OOD generalization
  • ICASSP'24 Multi-Level Augmentation Consistency Learning and Sample Selection for Semi-Supervised Domain Generalization [IEEE]

    • Multi-level augmentation for semi-supervised domain generalization
  • ICASSP'24 MMS: Morphology-Mixup Stylized Data Generation for Single Domain Generalization in Medical Image Segmentation [IEEE]

    • Morphology-mixup for domain generalization

1.Introduction and Tutorials (简介与教程)

Want to quickly learn transfer learning?想尽快入门迁移学习?看下面的教程。


2.Transfer Learning Areas and Papers (研究领域与相关论文)


3.Theory and Survey (理论与综述)

Here are some articles on transfer learning theory and survey.

Survey (综述文章):

Theory (理论文章):


4.Code (代码)

Unified codebases for:

More: see HERE and HERE for an instant run using Google's Colab.


5.Transfer Learning Scholars (著名学者)

Here are some transfer learning scholars and labs.

全部列表以及代表工作性见这里

Please note that this list is far not complete. A full list can be seen in here. Transfer learning is an active field. If you are aware of some scholars, please add them here.


6.Transfer Learning Thesis (硕博士论文)

Here are some popular thesis on transfer learning.

这里, 提取码:txyz。


7.Datasets and Benchmarks (数据集与评测结果)

Please see HERE for the popular transfer learning datasets and benchmark results.

这里整理了常用的公开数据集和一些已发表的文章在这些数据集上的实验结果。


8.Transfer Learning Challenges (迁移学习比赛)


Journals and Conferences

See here for a full list of related journals and conferences.


Applications (迁移学习应用)

See HERE for transfer learning applications.

迁移学习应用请见这里


Other Resources (其他资源)


Contributing (欢迎参与贡献)

If you are interested in contributing, please refer to HERE for instructions in contribution.


Copyright notice

[Notes]This Github repo can be used by following the corresponding licenses. I want to emphasis that it may contain some PDFs or thesis, which were downloaded by me and can only be used for academic purposes. The copyrights of these materials are owned by corresponding publishers or organizations. All this are for better adademic research. If any of the authors or publishers have concerns, please contact me to delete or replace them.

transferlearning's People

Contributors

chncaption avatar cmhungsteve avatar cvenwu avatar dependabot[bot] avatar dr-zhou avatar easezyc avatar houwenxin avatar jason-cs18 avatar jindongwang avatar kaiyangzhou avatar kevinlin311tw avatar lw0517 avatar lwpyh avatar maldil avatar mengchuangji avatar mrzhangxiaohua avatar orvindemsy avatar patrickzh avatar postbg avatar shandianchengzi avatar sun254 avatar tringwald avatar vinodkkurmi avatar wogong avatar wzell avatar x-lai avatar youngfish42 avatar yuntaodu avatar zhonglii avatar zzlongjuanfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transferlearning's Issues

DaNN的代码,直接跑的结果只有27%左右

首先感谢这个非常好的project,对迁移学习和领域适应做了相当完善的汇总。

我下载了其中DaNN(Domain Adaptive Neural Network)的代码,本地跑了一下,环境一致,只把data的rootpath改变,最终效果只有27%,请问你复现的时候设置什么超参数吗?

关于GFK应用上的一些问题寻求帮助

王老师您好!
我是一名学生,我在使用您编写的GFK算法matlab代码程序的时候出现了一些问题,我做了一些努力但问题能没有解决,希望能得到您的帮助。

我的程序是在matlab2016b上运行的,我的输入为X_src:400x16的矩阵,Y_src:400x1的列向量,X_tar:400x16的矩阵,Y_tar:400x1的列向量,dim:8;(源域样本和目标域样本的特征维数均为16(16个时域统计特征,未归一化),样本个数均为400)
程序在运行到:G = GFK_core([Ps,null(Ps')], Pt(:,1:dim));这一步报错了。具体错误为:

警告: 此串联操作包含列数不正确的空数组。
在未来的版本中,包含空数组的串联要求所有数组的列数相同。

In MyGFK>GFK_core (line 54)
In MyGFK (line 13)
In main (line 11)
错误使用 *
内部矩阵维度必须一致。
出错 MyGFK>GFK_core (line 53)
G = Q * [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2] ...

出错 MyGFK (line 13)
G = GFK_core([Ps,null(Ps')], Pt(:,1:dim));

出错 main (line 11)
[acc,G] = MyGFK(X_src,Y_src,X_tar,Y_tar,10);

我对GFK_core进行了检查,发现在
G = Q * [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2] ...

  • [B1,B2,zeros(dim,N-2dim);B3,B4,zeros(dim,N-2dim);zeros(N-2dim,N)]...
  • [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2]' * Q';
    这一步中,根据前面的程序得到的矩阵维数确实不一致:
    Q为16x16,
    [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2]为16x16,
    [B1,B2,zeros(dim,N-2dim);B3,B4,zeros(dim,N-2dim);zeros(N-2dim,N)].为20x20,
    [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2]' * Q'为16x16

此后,我对Q的值进行了检查,发现在Q=[Ps,null(Ps')]中,Ps为16x16矩阵,而null(Ps')的计算结果为空(16x0的矩阵)!而null函数在matlab中的功能是求解AX=0的解,null(Ps')的计算结果为空(16x0的矩阵)是否说明其无解?
此外,在zeros(dim,N-2dim)中,由于我设置的dim=8,因此,N-2dim<0,zeros(dim,N-2dim)为空矩阵。
由此,在程序
G = Q * [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2] ...

  • [B1,B2,zeros(dim,N-2dim);B3,B4,zeros(dim,N-2dim);zeros(N-2dim,N)]...
  • [V1, zeros(dim,N-dim); zeros(N-dim,dim), V2]' * Q';
    中出现的矩阵维数不匹配的问题是否由Q=[Ps,null(Ps')]以及zeros(dim,N-2*dim)为空?
    期待您的帮助,谢谢!

What about adding a wasserstein distance ver

Wasserstein Distance Guided Representation Learning for Domain Adaptation published this March on arXiv claims using wasserstein distance, which is a popular distance metric due its application inGAN, could have better results than DANN and CORAL. I think adding a wasserstein distance ver to this git project would be a good idea.

DaNN.py处的代码是不是有个地方写错了导致有点理解上的误导?

第19行,x_src = self.layer_hidden(x_src_mmd)
这里如果没有理解错的话应该是y_src = self.layer_hidden(x_src_mmd)吧?
根据main.py里train函数(第41行)y_src, x_src_mmd, x_tar_mmd = model(data, x_tar)里来看也应该是这样,虽然只是个命名的问题不会影响什么,但是改成y_src是不是更容易理解一点,前后也比较对应?

关于GFK算法中d的确定

王老师你好!我在应用GFK算法时,利用SDM方法确定d的个数,我的S是30x28的矩阵,T是30x28的矩阵,则S+T应该为60x28维的矩阵(不知道对不对?),再利用SDM求解两个domain与S+T的空间的夹角时,利用pca对三个数据集进行降维以后,不知道该怎么进行下一步求解sin(αd)和sin(βd)?我试过先求余弦值,再根据公式转换,但是求解数据长度不一致的余弦值应该怎么求?还有就是在求解夹角的时候是应该求pca以后的S和T与S+T的第1,2,…,d个向量的夹角,还是应该分别求d=1,2,3,…时的d维矩阵的夹角?

I think the CORAL loss is not correctly implemented.

The coral loss is not correctly implemented.

First, line 15 should be

loss = loss/(4*d*d)

instead of

loss = loss/(4*d*4)

Second, according to Frobenius Norm, after squaring each element and summing them, we should compute the square root of the sum, not the mean of it.

In line 14

loss = torch.mean(torch.mul((xc - xct), (xc - xct)))

should be

loss = (xc - xct).pow(2).sum().sqrt()

deepcoral的报错

RuntimeError Traceback (most recent call last)
in
115 model = load_pretrain(model)
116 for epoch in range(1, epochs + 1):
--> 117 train(epoch, model)
118 t_correct = test(model)
119 if t_correct > correct:

in train(epoch, model)
79 gamma = 2 / (1 + math.exp(-10 * (epoch) / epochs)) - 1
80 loss = loss_cls + gamma * loss_coral
---> 81 loss.backward()
82 optimizer.step()
83 if i % log_interval == 0:

~/anaconda3/envs/py36/lib/python3.6/site-packages/torch/autograd/variable.py in backward(self, gradient, retain_graph, create_graph, retain_variables)
165 Variable.
166 """
--> 167 torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
168
169 def register_hook(self, hook):

~/anaconda3/envs/py36/lib/python3.6/site-packages/torch/autograd/init.py in backward(variables, grad_variables, retain_graph, create_graph, retain_variables)
97
98 Variable._execution_engine.run_backward(
---> 99 variables, grad_variables, retain_graph)
100
101
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/generic/THCTensorMath.cu:26

想问一下这个错误怎么解决,与DDC,DAN同样的环境下跑的代码,自己查了一些解决方案,说是类别为-1的错误,但我感觉这个code里面应该不是这个问题,想问问有没有人遇到了同样的问题(anyone meet the same question?)

DAN的适配层数

王老师您好!近日配合着您的知乎专栏《小王爱迁移》的第四章按DaNN、DDC、DAN的顺序阅读了您的代码实现,注意到DDC、DAN两个实现中的代码都是类似这样的(以下是DAN 中 ResNet.py的代码):
`class DANNet(nn.Module):

def __init__(self, num_classes=31):
    super(DANNet, self).__init__()
    self.sharedNet = resnet50(False)
    self.cls_fc = nn.Linear(2048, num_classes)

def forward(self, source, target):
    loss = 0
    source = self.sharedNet(source)
    if self.training == True:
        target = self.sharedNet(target)
        #loss += mmd.mmd_rbf_accelerate(source, target)
        loss += mmd.mmd_rbf_noaccelerate(source, target)

    source = self.cls_fc(source)
    #target = self.cls_fc(target)

    return source, loss`

我没有使用过Pytorch,但我对这份代码的理解是DAN基于ResNet50,而后跟了一个self.cls_fc = nn.Linear(2048, num_classes)层,而forward中的代码代表我们对_一个cls_fc层_的输入进行了mmd适配,但我注意到您在知乎专栏第四章中提到,DAN的改进一是适配了多层(我的理解是需要_对后面多层的输入_都进行MMD约束),二是使用了MKMMD,因此这里是不是并不是与DAN原文完全匹配?一是代码中是_基于ResNet50而非AlexNet_,二是代码这里也是与您的DDC实现一样适配了一层(对_一个cls_fc层_输入进行了约束)。不知我的理解是否正确,还请能够指教!非常感谢!

options.dim不是可以随意设置吗,只要dim <= m。但试了一下,我的源数据是4000*485,目标数据是2000*485,

options.dim不是可以随意设置吗,只要dim <= m。但做了数次实验,我的源数据是4000485,目标数据是2000485。也就是说m=485.但是我这里设置dim为104<dim <=485,比如dim=485时,总在“knn_model = fitcknn(Zs',Y_src,'NumNeighbors',1);”报错。设置dim为dim <104,比如dim=100时,一切正常。 这在你的几个算法中都出现同样的问题,是基分类器KNN模型这儿有bug?还是前面有bug?还是我的数据太大(我自己觉得不大),还是程序不健壮?。。。 再次感谢感谢jingongwang关于mu问题的回复!

About Deep Coral loss

HI, Wang, thx for your code, it really helps me a lot.

In your Deep Coral Code(transferlearning/code/deep/DeepCoral/Coral.py), i found you use:

xm = torch.mean(source, 1, keepdim=True) - source

But in the origianl implementation, i think they use:
xm = torch.mean(source, 0, keepdim=True) - source
Is there any thing I have missed or this is a typo?

Could the part 2 of Open Set Domain Adaptation code be solved by NLopt and libsvm?

I found that the author used NLopt package to estimate W, and use libsvm to implement the part two of AIT. Could we just use those packages and get the second step done?
Also, I found in the paper that the author is using SCIP package to solve the assignment problem. Will changing the Matlab's intlinprog package to SCIP help us get better result?

关于DaNN的benchmark

DaNN原文实验是在office10上做的,所以benchmark的数据应该是office10的,不应该在office31里(或许应该标注一下?)

DDC中参数frozen

王老师您好,在阅读您的迁移学习教程的时候,个人认为DDC和DAN的前几层参数应该设置为frozen。
但是您的代码带load resnet50模型的时候,只是固定的weight中data的requires_grad=False.
这样是不是固定不住参数呢?
我认为实际上应该吧weight.requies_grad=False.
比如conv1的参数,如图:
ddc1
ddc2
可能理解的不是很准确,请指教。

怎样入门迁移学习?

你好,我是刚刚入学研一的新生,老师指定的方向是迁移学习。看大哥在雷锋网,知乎上面发布很多迁移学习资料,大哥是厉害之人,相大哥请教一下零基础的小白怎么入门迁移学习?方便的话留下大哥的联系方式(QQ),在此谢过。

添加几篇新的论文

深度学习用在语义分割上面的
FCNs in the Wild: Pixel-level Adversarial and Constraint-based Adaptation
Curriculum domain adaptation for semantic segmentation of urban scenes
No More Discrimination: Cross City Adaptation of Road Scene Segmenters
Learning to Adapt Structured Output Space for Semantic Segmentation
Fully Convolutional Adaptation Networks for Semantic Segmentation
这些方法好多都是去年ICCV visDA 分割任务排名靠前的方法。
还有王老师能不能利用您的影响力建一个迁移学习的群组?。。感觉现在做这个越来越多。。大家都没一个讨论的地方。 麻烦了

Puzzle about MMD

thanks again for the nice program u provide. but i'm just puzzling about the mmd, here is my question: does the ground truth labels of the datasets affects the mmd value?
it's saying, if we have datasets A and B here, then we can compute the mmd value between A and B, but what i dont know is that: whether the labels of the samples is used to compute the mmd value? Cause from what i see in the program, it seems that the labels dont matter the result value.
thanks to everyone whom would check this and help me solving this puzzle.

KeyError: 'bn1.num_batches_tracked'

KeyError Traceback (most recent call last)
in ()
115 if cuda:
116 model.cuda()
--> 117 model = load_pretrain(model)
118 for epoch in range(1, epochs + 1):
119 train(epoch, model)

in load_pretrain(model)
48 for k, v in model_dict.items():
49 if not "cls_fc" in k:
---> 50 model_dict[k] = pretrained_dict[k[k.find(".") + 1:]]
51 model.load_state_dict(model_dict)
52 return model

KeyError: 'bn1.num_batches_tracked'

关于Benchmark中的实验结果

你好,我想请问下benchmark中的那些对比的实验结果,是你复现之后的结果吗?GFK、TCA在Office-31任务上和论文中公布的结果(DCORAL有和GFK、TCA等对比)有一定的出入,想请教下,谢谢!

English Version

Hey @jindongwang,

Your repository is great but the only problem is in Chinese. It would be great to open a new repository to have all the information in English.

Best

about DA usage scenario

Hi, it‘’s my first time to try domain adaptation. Here is my scenario: i am doing a image classification task, there are already 100k training data with labels (called A), i also can obtain large data with no labels (called B) . Data A and B's domain shift are small. The plan i choose now is only using data A to train a model, and then predict samples from B directly. the results is also good. when i annotating more data from B, and use them and data A together to train, the results are better. It makes sense. However, to reduce the work of annotating lots of images, my question is can i treat A as source data , B as target data to improve accuracy further (i.e., adding data B in training phase compared with current plan) .

A question about Resnet structure in DAN

Thank u very much for providing a nice reference. After reading the article of DAN and python code you provided, i have a deeper comprehension about the article.

My question, generally speaking, is that the deep learning structure you choose is Resnet, which is different from the original article. But i have no idea about which layers have you fixed, fine-tuned and tailored. Can you propose a detailed explanation?

Thank u very much!

Fine-tune on office-31

As Jindong points out, I also cannot reimplement the source-only result on office-31 by fine-tuning. Is anyone successful?

Missing LICENSE file

Hi, following our brief discussion here, I wanted to start integrating some of your code into salad. Could you advise under which (open-source) license you released your code? That would be needed for properly attributing your work :) Thanks a lot!

DAN

你好,很感谢提供这么全面的资料。但是我在跑 DAN.py 的时候,无论用哪个数据集,accuracy 都是 100.00%,这个结果感觉不太对,这是不是代码有哪里需要注意的么?

关于目标域无标签迁移的问题

王博士您好~ 我目前比较关注domain adaptation这一块 但是我发现比较常用的DANN DCN等都是基于目标域有标签进行的 请问如果我想进行目标域无标签或者标签类别不足(Atask有n类 Btask数据有n类 但只有m类标签(m<n))情况下的迁移学习 应该关注哪些?
感谢您的回答~

NaN matrix produced by TCA python code

...
72    n_eye = m if self.kernel_type == 'primal' else n
73    a, b = np.linalg.multi_dot([K, M, K.T]) + self.lamb * np.eye(n_eye), np.linalg.multi_dot([K, H, K.T])
74    w, V = scipy.linalg.eig(a, b)
...

When I use the code, the value in matrix K, M, H is so small that the result of line 73 is two matrix of NaN. Then the program stops due to the NaN matrix.

So does this mean some dataset might be unable to use TCA code ? Maybe I should do some pre-process with my dataset ?

AlexNet finetune on Office-31

Hey, I am having the exact same problem on reproducing the Office-31 finetune results. I am currently trying to reproduce the 64.2% source-only baseline on Amazon->Webcam task in this paper:
https://arxiv.org/pdf/1602.03534.pdf

So far, the best result I get is around 56% using the following setup, which is higher than your reported 46%. Something is still wrong tho.

Network: .... fc7 -> fc(128) ->fc(31)
lr: 2.5e-3
Preprocess: Resize(256) + RandomCrop(227)
Optimizer: tf.train.MomentumOptimizer(lr, 0.9)
Trainable: Only fc6, fc7, fc(128), fc(31)
No weight decay.

Let's keep in contact QwQ

请问TCA降维后的数据通常怎么使用

看cta_python的测试代码, 源数据是162维, x_src取前81维作为源域数据, y_src取后81维, 然后fit_transform, 返回x_src_tca和x_tar_tca两份降到30维后的数据, 请问之后模型是只对x_src_tca数据进行训练, 而用x_tar_tca来验证, 还是说两个降维数据都是要用来做训练的?

DAN and DDC中的load_pretrain(model)函数

你好大神,我是在知乎上请教你的本科学生,来这边继续提问。有关我的精度100的问题,已经在issue里面找到答案了
除此之外,我觉得在DAN and DDC中的load_pretrain(model)函数是否有问题
for k, v in model_dict.items():
if not "cls_fc" in k:
model_dict[k] = pretrained_dict[k[k.find(".") + 1:]]
这是您的源代码,我跑出来会出现num_batches_tracked错误,查了一些资料,我做了如下修改
-------->
1 pretrained_dict = {k: v for k, v in pretrained_dict.items() if k in model_dict}
2 pretrained_dict ={ k:v for k,v in pretrained_dict.items() if k in model_dict and v.size() == model_dict[k].size() }
3 model_dict.update(pretrained_dict)
4 model.load_state_dict(model_dict)
其中1 2 步做任意一个即可。我刚接触python以及pytorch,不知道是否与环境有很大关系 。这里提供一个可能是解决方案的方法。

其他领域的多任务学习

楼主介绍的很多都是CV领域的迁移学习
Sebastian有一篇整体介绍的博客,包括CV和NLP
生物、基因、药物领域都有很多迁移学习,不过都没有survey形式的整体介绍

出错 MyJGSA (line 93) , [W,~] = eigs(Smax, Smin+1e-9*eye(2*nst), dim, 'LM');我试了几次,总是有问题

错误信息如下,希望大家看一下,谢谢!
错误使用 eigs/checkInputs/LUfactorB (line 952)
B 为奇异矩阵。
无法计算指定的特征值,因为存在无穷大的特征值。

出错 eigs/checkInputs (line 791)
[LB,UB,ppB,qqB,dgB] = LUfactorB;

出错 eigs (line 94)
[A,Amatrix,isrealprob,issymA,n,B,classAB,k,eigs_sigma,whch, ...

出错 MyJGSA (line 93)
[W,~] = eigs(Smax, Smin+1e-9eye(2nst), dim, 'LM');

关于DaNN的几个问题

1、在原始论文论文,Algorithm 1中,计算完MMD的梯度后,更新的参数是U1,即输入层到隐藏层的参数。在main.py的第49、50行,更新的是所有的参数?
2、main.py中第34行设batch_j=0,这个变量只在第37行时使用了。这个变量一直是0吗?在计算MMD时,应用用上所有的目标域数据吧?
非常感谢解答!

DAN

I found in mmd.py, there are two implementation: mmd_rbf_accelerate and mmd_rbf_noaccelerate.
What's the difference? And why do you choose mmd_rbf_noaccelerate?

Thank you

question about CORAL_SVM.m

Hi Jindong,

I really love your repo about the transfer learning! Just a question about the implement about CORAL method.

In CORAL_SVM line 22, I think Sim_Trn = trainset * M * trainset' is used to compute the pre-computed kernel for the use of libsvm train. However, I think the transformed training data should be (trainset * M), thus the kernel should be (trainsetM) * (trainsetM)'.

Am I missing anything?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.