Git Product home page Git Product logo

Comments (2)

EtienneCmb avatar EtienneCmb commented on June 5, 2024

Hello @StanSStanman !

Thanks for pointing me out the issue. Probably the best way to fix it would be that the self._reshape becomes a list of shapes instead of just the shape of the first element. Something like :

In ds_ephy :

self._reshape = None
if all([k.ndim == 4 for k in x]):
    logger.debug(f"    4d reshaping")
    self._reshape = []
    for k in range(len(x)):
        n_e, n_r, n_f, n_t = x[k].shape
        x[k] = x[k].reshape(n_e, n_r, n_f * n_t)
        self._reshape.append((n_f, n_t))

Then, you also need to modify the WfMi with something like :

self._reshape = dataset._reshape
if isinstance(self._reshape, list):
    logger.debug(f"    reshaping before computing statistics")
    for k in range(len(mi)):
        n_f, n_t = self._reshape[k]
        n_p, n_s, _ = mi_p[k].shape
        mi[k] = mi[k].reshape(n_s, n_f, n_t)
        mi_p[k] = mi_p[k].reshape(n_p, n_s, n_f, n_t)

If you want to test your code, there's one example illustrating spatio-temporal clusters (online doc and github code).

I suggest that you modify this example such that each simulated subject has a different number of trials. Then you can start to modify the scripts and submit the PR.

What do you think?

from frites.

StanSStanman avatar StanSStanman commented on June 5, 2024

Hello @EtienneCmb

Thanks for your answer. As we discussed trough other channels, I'm going to fix the bug, but without transforming shape._reshape in a list of tuples.
Indeed this attribute is in the form of (n_freqs, n_times) and those two dimensions should remains the same across all the subjects.

I will also update the example code, to include the case of computing mi across subjects with a variable number of trials.

See you soon!

from frites.

Related Issues (12)

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.