GithubHelp home page GithubHelp logo

Comments (6)

ZitongLu1996 avatar ZitongLu1996 commented on August 18, 2024 1

Very nice question!
In some cases, the correlation coefficient is used to describe the similarity ignoring the value is positive or negative. So I use a np.abs() function here... In many functions in module rdm_cal, you can find a parameter abs. By this parameter, user can select to calculate the 1-r or 1-abs(r). I' sorry that I didn't add this choice when sub_opt=1 in function bhvRDM. Under this special condition, we cannot calculate the Pearson correlation and we can only calculate the distance. But sorry again, I forget to add a choice for users to select whether computing the absolute distance or not for this condition. I'll update NeuroRA soon!
Thanks for your careful reading my codes!

from neurora.

ZitongLu1996 avatar ZitongLu1996 commented on August 18, 2024 1

Hi, Arjun! I just updated NeuroRA!
You can download the new version 1.1.3.4: pip install --upgrade neurora
In this version, if you set abs=False, the dissimilarity would be 1-dis not 1-abs(dis).

If you want to put the nodes' values of each layer in CNN, I recommend that you can let the shape of the data_ly_i as [n_conditions, n_nodes, 1] for layer i in a CNN model as the input for bhvRDM function. like:
RDM_ly_i = bhvRDM(data, sub_opt=0, abs=False)
By this replacement (nodes as the subjects), you can obtain the RDM for each CNN layer with the dissimilarity in a RDM by calculating the 1 - correlation coefficient between vector1=[valueofnode1_condition1, ... , valueofnoden_condition1] and vector2=[valueofnode1_condition2, ... , valueofnoden_condition2]. And so on...

Hope this help! If you have any other questions, you can ask me.

from neurora.

ZitongLu1996 avatar ZitongLu1996 commented on August 18, 2024 1

I think my suggestions above can work. RDM_ly_i = bhvRDM(data, sub_opt=0, abs=False) by this line-code, the calculation is base on Pearson correlation (you can see the codes line 113 - 142, especially line 135 in rdm_cal.py) and the dissimilarities in RDM are calculated by 1-r.
I think I have answered your question...

from neurora.

ZitongLu1996 avatar ZitongLu1996 commented on August 18, 2024 1

Maybe you are puzzled about how to put the data of a CNN into bhvRDM? For example, in a certain CNN, its layer i has 64 feature maps (size of each feature map is 128 by 128). You can spread this 64 by 128 by 128 array into a vector which shape will be [1048576]. So n_nodes=1048576 here, and as the suggestion I told yesterday, the shape of the data as the input of layer i in certain CNN for RDM calculation should be [n_conditions, n_nodes, 1]. Then use RDM_ly_i = bhvRDM(data, sub_opt=0, abs=False), you can get a RDM corresponding to layer i.
Hope this more detailed explanation help!

from neurora.

arjung128 avatar arjung128 commented on August 18, 2024

Hi Zitong!

Thank you very much for your prompt reply. I was very impressed by how quickly you responded to my question and updated the library -- Thanks a ton!

I'm sorry, I do not fully understand: bhvRDM still uses absolute distance and not the Pearson correlation for obtaining the RDM, correct? I am not sure how / whether I can use this function to get RDM values of CNN representations (3D) based on the Pearson correlation using this function... is this possible? Or are you suggesting I can write my own function to do this with the equation in your response?

Thanks once again! :)

from neurora.

arjung128 avatar arjung128 commented on August 18, 2024

Oh I see now. Sorry, I had missed line 135. Thanks so much, Zitong!

from neurora.

Related Issues (4)

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.