Git Product home page Git Product logo

tlbook-code's Introduction

Code for 'Introduction to transfer learning' book 《迁移学习导论》(第二版)代码

This folder contains the codes for the book Introduction to Transfer Learning: Algorithms and Practice. 迁移学习导论.

Links for the Chinese book (2nd edition) can be found at: links.md. 中文第二版书中的链接请见这里

Dataset

  1. For algorithm chapters (chapters 1 ~ 11), we mainly use Office-31 dataset, download HERE:
  • For non-deep learning methods (chapters 1~7), we use ResNet-50 pre-trained features. Thus, download the ResNet-50 features.
  • For deep learning methods (chapters 8~11), we use Office-31 original dataset. Thus, download the raw images.
  1. For application chapters (chapters 15~19), the datasets download link can be found at respective chapters.

Requirements

The following is a basic environment to run most experiments. No special tricky packages are needed. Just pip install -r requirements.txt.

  • Python 3.x
  • scikit-learn
  • numpy
  • scipy
  • torch
  • torchvision

Citation

If you find the code or the book helpful, please consider citing our book as:

@book{tlbook,
 author = {Wang, Jindong and Chen, Yiqiang},
 title = {Introduction to Transfer Learning: Algorithms and Practice},
 year = {2023},
 url = {jd92.wang/tlbook},
 publisher = {Springer Nature}
}

@book{tlbookchinese,
 author = {王晋东 and 陈益强},
 title = {迁移学习导论},
 year = {2021},
 url = {jd92.wang/tlbook}
}

Recommended Repo

My unified transfer learning repo (and the most popular transfer learning repo on Github) has everything you need for transfer learning: https://github.com/jindongwang/transferlearning. Including: Papers, codes, datasets, benchmarks, applications etc.

tlbook-code's People

Contributors

jindongwang avatar lw0517 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

tlbook-code's Issues

第二版85页SVM公式请教

作者您好!近期读到第二版85页“带有概率密度比的SVM”公式第二项β前为什么有负号,在“Density ratio estimation in support vector machine for better generalization: study on direct marketing prediction”论文中该项没有负号,不是很理解
期待您的回复!

在models部分有关bottleneck_layer位置的问题

在您的这本书提供的models.py的code中,在forward函数中,source和target是先过了classifier_layer,再通过bottleneck_layer
但是在DeepDA提供的code中,是先通过bottleneck_layer再通过classifier_layer
想问下以上两种方式哪种是正确的,抑或是都可以?

DANN训练无效问题

东哥好,我使用DANN训练自己的问题时,其域分类精度一开始就是50%左右(transfer loss大约在0.7),并且一直维持在这个值,未曾有变化,感觉域分类器并没有很好的work,已调整过学习率、transfer_loss权重等参数,但均无改变。不知到应该怎么调整代码?
微信图片_20231110140322
部分输出如下:
Epoch [1/10] - T_Loss:2.7179, R_loss:2.016,D_loss:0.702,D_acc:50.117%
Val_Loss(MSE):2.262,Val_MAE:1.242,Val_R2:0.633
lr [0.0001]
Epoch [2/10] - T_Loss:2.5103, R_loss:1.803,D_loss:0.708,D_acc:45.898%
Val_Loss(MSE):1.774,Val_MAE:0.929,Val_R2:0.713
lr [0.0001]
Epoch [3/10] - T_Loss:1.9520, R_loss:1.252,D_loss:0.700,D_acc:49.336%
Val_Loss(MSE):1.301,Val_MAE:0.828,Val_R2:0.789
lr [0.0001]
Epoch [4/10] - T_Loss:1.9570, R_loss:1.255,D_loss:0.702,D_acc:48.945%
Val_Loss(MSE):1.319,Val_MAE:0.777,Val_R2:0.786
lr [0.0001]
Epoch [5/10] - T_Loss:1.6281, R_loss:0.927,D_loss:0.701,D_acc:48.398%
Val_Loss(MSE):1.368,Val_MAE:0.901,Val_R2:0.778
lr [0.0001]
Epoch [6/10] - T_Loss:1.4805, R_loss:0.779,D_loss:0.701,D_acc:47.474%
Val_Loss(MSE):1.161,Val_MAE:0.759,Val_R2:0.812
lr [0.0001]
Epoch [7/10] - T_Loss:1.3071, R_loss:0.607,D_loss:0.701,D_acc:48.737%
Val_Loss(MSE):1.031,Val_MAE:0.697,Val_R2:0.833
lr [0.0001]
Epoch [8/10] - T_Loss:1.3438, R_loss:0.643,D_loss:0.701,D_acc:46.276%
Val_Loss(MSE):1.019,Val_MAE:0.691,Val_R2:0.835
lr [0.0001]
Epoch [9/10] - T_Loss:1.2132, R_loss:0.513,D_loss:0.700,D_acc:47.826%
Val_Loss(MSE):1.019,Val_MAE:0.650,Val_R2:0.835
lr [0.0001]
Epoch [10/10] - T_Loss:1.1207, R_loss:0.421,D_loss:0.700,D_acc:48.333%
Val_Loss(MSE):0.911,Val_MAE:0.627,Val_R2:0.852

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.