hugorichard / fastsrm Goto Github PK
View Code? Open in Web Editor NEWStandalone implementation of FastSRM
License: MIT License
Standalone implementation of FastSRM
License: MIT License
https://github.com/hugorichard/FastSRM/blob/master/fastsrm/check_inputs.py#L424
This contradicts the logic of SRM, that does not require a fixed spatial layout across individuals.
@hugorichard could we discuss about that ?
TypeError Traceback (most recent call last)
in
----> 1 fast_srm_ica.add_subjects(sub_movie, shared_resp_ica)
~/FastSRM/fastsrm/fastsrm.py in add_subjects(self, imgs, shared_response)
1752 else:
1753 path = os.path.join(
-> 1754 self.temp_dir, "basis_%i" % (len(self.basis_list) + i))
1755 np.save(path, basis_i)
1756 basis.append(path + ".npy")
TypeError: object of type 'NoneType' has no len()
add_subjects() works well if I use it on a model that has been fit previously.
When run on
`
X = [np.random.rand(10, 12) for _ in range(2)]
Xnew = [np.random.rand(10, 12)]
srm = FastSRM(n_components=12, n_iter=10, verbose=True,)
srm.fit(X)
S = srm.transform(X)
print(S.shape)
srm.add_subjects(Xnew, S)
`
The fit does not complain and an error is thrown on add_subjects.
This is missleadind. An error should be thrown at fit time when n_components > min(n_features, n_samples).
This is because check_imgs is applied in transform() (line 1400) and raises error, but in fact these checks are not needed here (at least for time dimension).
When adding fastSRM as an fmralign dependency, we see a build failure. Local installation confirms this is a deprecation from pip:
DEPRECATION: fastsrm 0.0.4 has a non-standard dependency specifier scipy>=0.18.0numpy>=1.12scikit-learn>=0.23joblib>=1.1.0matplotlib>=2.0.0pytest>=6.2.5. pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of fastsrm or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063
We can correct this by adding delimiters in fastSRM's install_requires.
I'll open a PR for this, but please let me know how you'd like to handle longer term maintenance, @hugorichard ! i.e., should we vendor the relevant code within fmralign ? Any thoughts are appreciated !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.