Giter Club home page Giter Club logo

Comments (4)

FL33TW00D avatar FL33TW00D commented on June 6, 2024 1

Thank you @FL33TW00D for your quick reply. I am indeed trying to use this for my research. I would need to dive deeper into the code (maybe re-implement it), although it seems there's no big reason as your Rust DTW package does a great job calculating the 1D output vectors using DTW.

I am interested myself in the ABIDE dataset and I was expecting I could use DTW to compare against Pearson's correlation coefficient calculations. If I use i_lower like this in the loop I am not getting a symmetric connectivity matrix as a result as I would expect (nregions x nregions). Does i_lower need to be part of a for loop iteration? Not sure I get the 1D->2D conversion here.

Considering this, it would be amazing if you could re-release a version of this notebook.

I will release a new version of the library and the notebook this weekend 👍🏻

from rustdtw.

FL33TW00D avatar FL33TW00D commented on June 6, 2024

Hi @wizofe,
Apologies for this, seems the notebook is incomplete.

I no longer have this setup on my machine, but can give some quick guidance to unblock you. If you're using it for a project I'll find some time to release a new version to clean some things up.

The code you're referring to:

    #Post processing them as per paper recommendations
    for vec in dtw_output:
        sym = np.zeros((n_regions, n_regions))
        sym[i_lower] = vec
        sym += sym.T
        sym *= -1
        StandardScaler().fit_transform(sym)
        connectomes.append(sym_matrix_to_vec(sym))

This is transforming the 1D output vectors from rust-dtw into a normalized 2D matrix, as per the original source code here: https://github.com/MRegina/DTW_for_fMRI/blob/master/Source.cpp#L89 . Therefore, i_lower should be the indices of the lower triangular matrix, which you could generate like so:

i_lower = np.tril_indices(n_regions)

This should work, let me know if you have trouble.

from rustdtw.

wizofe avatar wizofe commented on June 6, 2024

Thank you @FL33TW00D for your quick reply. I am indeed trying to use this for my research. I would need to dive deeper into the code (maybe re-implement it), although it seems there's no big reason as your Rust DTW package does a great job calculating the 1D output vectors using DTW.

I am interested myself in the ABIDE dataset and I was expecting I could use DTW to compare against Pearson's correlation coefficient calculations. If I use i_lower like this in the loop I am not getting a symmetric connectivity matrix as a result as I would expect (nregions x nregions). Does i_lower need to be part of a for loop iteration? Not sure I get the 1D->2D conversion here.

Considering this, it would be amazing if you could re-release a version of this notebook.

from rustdtw.

wizofe avatar wizofe commented on June 6, 2024

@FL33TW00D that would be amazing. Let me know when you do so! Thank you!

from rustdtw.

Related Issues (2)

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.