Giter Club home page Giter Club logo

sca's Introduction

Scatter Component Analysis (SCA)

MATLAB implementation of Scatter Component Analysis for domain generalization proposed in paper

Ghifary, M., Balduzzi, D., Kleijn, W. B., & Zhang, M. (2017). Scatter component analysis: A unified framework for domain adaptation and domain generalization. IEEE transactions on pattern analysis and machine intelligence, 39(7), 1414-1430.

Getting Started

Prerequisites

The code is tested using MATLAB R2017b on Windows 10. Any later version should work normally.

Running the tests

In MATLAB, change your current folder to "SCA" and run one of the file demo.m to see whether it could run normally.

The file demo.m does the following:

  1. Load synthetic data from "./syn_data/data.m";

  2. Prepare source sample sets (put sample sets 1, 2 in a MATLAB cell array), validation set (sample sets 3, 4 in a matrix), and test set (sample set 5 in a matrix);

  3. Learn transformations using SCA on the source sample sets and validate hyperparameters on the validation set.

  4. Apply the optimal transformation on the test set.

Apply on your data

Usage

Change your current folder to "SCA" and use the following commands

[test_accuracy, predicted_labels, Zs, Zt] = SCA(X_s_cell, Y_s_cell, X_t, Y_t, params)

Description

Function SCA()

Input Description
X_s_cell cell of (n_s*d) matrix, each matrix corresponds to the instance features of a source domain
Y_s_cell cell of (n_s*1) matrix, each matrix corresponds to the instance labels of a source domain
X_t (n_t*d) matrix, rows correspond to instances and columns correspond to features
Y_t (n_t*1) matrix, each row is the class label of corresponding instances in X_t
params optional parameters, details can be found in SCA.m
Output Description
test_accuracy test accuracy on target instances
predicted_labels predicted labels of target instances
Zs projected source domain instances
Zt projected target domain instances

Authors

  • Shoubo Hu - shoubo [dot] sub [at] gmail [dot] com

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

sca's People

Contributors

amber0309 avatar

Stargazers

 avatar  avatar  avatar  avatar Peipei_Kang avatar  avatar  avatar  avatar  avatar  avatar Adi Lin avatar GeeQiNCHuaNP avatar sd21 avatar  avatar WeiDongdong avatar Jindong Wang avatar Maple avatar

Watchers

James Cloos avatar  avatar

sca's Issues

Questions about implementation

Hi,
Thx for a great implementation!

I have some questions about it compared to the paper:
File SCA_quantities.m:

Line 99:
I assume this implements calcultion of Ps (equation (13) in the paper).
Why there's no multiplication by nk?

Line 106 and onwards:
I assume this implements calculation of Qs (equation (14) in the paper).
The implementation looks very different from the equation.
Could you please explain?

Line 118 and onwards:
I assume D equals K*L*K in the paper (equation (20)).
The implementation looks very different from that.
Could you please explain?

Also, Algorithm 1 in the paper tells to first center the kernel at step 2 and then solve for B* in step 3. It follows, that D would need to be calculated with a centered kernel. But the code doesn't look like doing so (line 126).

Demo files, e.g. demo_2a_2a.m:
Line 69:
Why are the kernels centered with H?
In the paper, the only place where such centering is applied is in calculation of Qs in equation (14).
Please explain.

Thank you,
David

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.