ganguli-lab / twpca Goto Github PK
View Code? Open in Web Editor NEW๐ Time-warped principal components analysis (twPCA)
License: MIT License
๐ Time-warped principal components analysis (twPCA)
License: MIT License
Trial lengths can be variable in some experiments. We should extend twPCA to handle this by simply ignoring NaN
values in the data tensor. Users still specify the data as a trials x time x neuron
array, but indicate missing data with nans.
Another possibility would be to pass in a vector holding the indices of trial start or end:
model = TWPCA(n_components).fit(data, trial_start=..., trial_end=...)
this can result in invalid warping functions with negative slope
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
~\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
241 else:
--> 242 return load_dynamic(name, filename, file)
243 elif type_ == PKG_DIRECTORY:
~\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
341 name=name, loader=loader, origin=path)
--> 342 return _load(spec)
343
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-40-fe2dcd6c15ce> in <module>
----> 1 from twpca import TWPCA
2 from twpca.datasets import jittered_neuron
3
4 # generates a dataset consisting of a single feature that is jittered on every trial.
5 # This helper function returns the raw feature, as well as the aligned (ground truth)
~\Anaconda3\lib\site-packages\twpca\__init__.py in <module>
8 __version__ = '0.0.2'
9
---> 10 from .model import TWPCA
11 from . import regularizers
12 from . import utils
~\Anaconda3\lib\site-packages\twpca\model.py in <module>
4 from tqdm import trange
5
----> 6 import tensorflow as tf
7 from . import warp, utils
8 from .regularizers import l2, curvature
~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43
~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
48 import numpy as np
49
---> 50 from tensorflow.python import pywrap_tensorflow
51
52 # Protocol buffers
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
67 for some common reasons and solutions. Include the entire stack trace
68 above this error message when asking for help.""" % traceback.format_exc()
---> 69 raise ImportError(msg)
70
71 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\arpit\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\arpit\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\arpit\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\arpit\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\arpit\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
... after the recent PR that was merged ๐
For more information about TWPCA, you had provided "Abstract" and "poster". But the link does not work.
Please., correct these links.
Thank you
currently we compute reconstruction error by summing over comopnents. Instead, we should compute the mean by normalizing by the number of elements. This will hopefully make the choice of regularization hyperparameters more robust across datasets.
For discrete data like spikes the transform
function that maps the data into the aligned space can smear out the spikes in time, leading to continuous values. We should add an option to either round spikes to the nearest bin, or return the continuous times of the spikes in the aligned space.
Users should have the ability to specify different loss functions. A few easy ones:
In the case of Logistic/Poisson loss functions, this would remove the need to smooth the data as a preprocessing step (see #2), but would necessitate adding regularization for smoothness on the temporal factors. This could also help with #3 - e.g. the reconstruction can be interpreted as a probability of spiking in the logistic case.
Hey, I was trying to get the demo to work after pip installing and in Python 2.7 and 3.6 on Windows and 3.6 on Mac, but running even the demo notebook returned an error: "fit() missing 1 required positional argument: 'X'". Pulling the latest version from this repo worked, but it seems there is something broken in the pip version that was patched in the github version.
When calling fit
, we should append to obj_history
(instead of reinitializing it) if reinitialize
is set to False
Currently we do this for spiking datasets, but it is not a part of the twpca
package yet. We could incorporate a smooth
kwarg that applies some temporal smoothing to data before model.fit
is called. Then model.transform
would transform the original data.
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.