Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeremy Manning
    @jeremymanning
    welcome to our "gitter!"
    Teon L Brooks
    @teonbrooks
    howdy folks! :)
    Andy Heusser
    @andrewheusser
    hey teon! we are getting pumped for the mozilla sprint :running:
    Teon L Brooks
    @teonbrooks
    awesome, I’m pumped too! i’m hosting a site down in Mountain View on Thursday and Friday
    Emre Şafak
    @esafak
    has this been tested on OSX? I'm not seeing animation trails. what notebook settings are required?
    Emre Şafak
    @esafak
    it seems I have to click on the canvas and move the mouse around to maintain animation. This can't be right. I've tested on jupyter notebook 5 with python 3.5, matplotlib 2.0. I am testing this notebook: https://github.com/ContextLab/hypertools/tree/master/docs/auto_examples/animate.ipynb
    Jeremy Manning
    @jeremymanning

    Yes, we've tested on OSX. For that demo the animation pops up in a new window-- I don't believe matplotlib animations are supported directly in jupyter notebooks.

    As in that example code, to create an animated plot, use the animate=True flag. For example:

    hyp.plot(data, animate=True)

    If you want animation trails, use
    hyp.plot(data, animate=True, chemtrails=True)
    (historical note: the chemtrails name is inspired by this conspiracy theory https://en.wikipedia.org/wiki/Chemtrail_conspiracy_theory)
    Jeremy Manning
    @jeremymanning
    Another note: if the above doesn't work on your setup, it's possible you've found a bug (in which case please consider opening an issue about it)
    Emre Şafak
    @esafak
    I can launch a new window with %matplotlib osx or not using %matplotlib notebook but I'm just not getting any animation without keeping the mouse button pressed. I don't want to file it as a bug because I don't know if it's my fault; pls get confirmation.
    Jeremy Manning
    @jeremymanning
    Hmmm... what specific command are you using? I've never encountered a mouse button pressing issue, but it could be something obscure...
    Emre Şafak
    @esafak
    I'm using hyp.plot(), following that notebook precisely. I've tested on Safari 10.1 and Chrome
    Jeremy Manning
    @jeremymanning

    hi @esafak --

    Let's try to separate out the various components of your setup. If you run a python session (not in a jupyter notebook-- just using python from Terminal), can you try running the following three lines (after first running pip install --upgrade hypertools prior to starting python, to make sure you have the latest version):

    import hypertools as hyp
    x = hyp.tools.load('spiral')
    hyp.plot(x, animate=True, chemtrails=True, duration=10)

    A new window should pop up with the animation, which should last for 10 seconds. After the animation finishes, you should be able to interact with the plot with your mouse. Can you let me know if this is what happens on your computer?

    I just confirmed that this works on OSX, on both Python 2.7 and Python 3.5, with the version of hypertools that's on pip (0.1.7).

    Emre Şafak
    @esafak

    I only get this UserWarning, no animation or image

    This call to matplotlib.use() has no effect because the backend has already
    been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
    or matplotlib.backends is imported for the first time.
    
      warnings.warn(_use_error_msg)

    I also forgot to mention you forgot to include requests in your requirements.txt file

    Andy Heusser
    @andrewheusser
    Hi @esafak are you running this within the context of a jupyter notebook? if so, can you try it in a regular python script?
    Emre Şafak
    @esafak
    yes, I was. after trial and error I got it to work with the 'qt' backend. unfortunately I have not been able to get it to work in the notebook too. the closest I could get was the frame of the cube using %matplotlib inline
    Jeremy Manning
    @jeremymanning
    Can you try pip install --upgrade hypertools? We've just released a new version.
    Emre Şafak
    @esafak
    no luck yet. which backend and browser do you successfully use with notebooks in osx? I've tried auto, osx, inline, notebook, qt5.
    Jeremy Manning
    @jeremymanning
    I've been using Google chrome... Here's a binder with the notebooks to further illustrate how they should work: http://mybinder.org/repo/contextlab/hypertools-paper-notebooks
    Emre Şafak
    @esafak
    there are no animations there! when I picked temperatures and animated the entry Static 3D image: plot the high-dimensional data in a low dimensional space by adding animate=True I got the same blank output as I do locally.
    Andy Heusser
    @andrewheusser

    @esafak while static plots should work just fine, hypertools animations are not yet supported inside jupyter notebooks (but they should definitely work outside of the notebook). i've worked on this problem a bit, but its not implemented in the package. part of it is that you need a particular ffmpeg codec to animate inside a notebook: https://stackoverflow.com/questions/42133545/animations-in-ipython-jupyter-notebook-valueerror-i-o-operation-on-closed-f/43396335#43396335. The second piece is to detect that hypertools is being run within a notebook and then convert the line animation to html5 video (something like this):

        if jupyter:
            from IPython.display import HTML
            HTML(line_ani.to_html5_video())

    Today and tomorrow, hypertools is part of the Mozilla code sprint, and we will be working with the community to improve the package. If you are interested in helping with this piece, we'd be happy to have you, and i'd be happy to provide any guidance / answer any questions. let me know!

    Emre Şafak
    @esafak
    thanks and good luck with the sprint! it would be nice to mention this limitation in the docs so people don't waste time.
    Aly Sivji
    @alysivji
    @andrewheusser also on here. if you want to get in touch
    Ryan Arredondo
    @rarredon
    Just submitted a PR for Issue #105. Anything else I can work on?
    Andy Heusser
    @andrewheusser
    hey @rarredon - taking a look at the issues and ill let you know in a sec!
    Ryan Arredondo
    @rarredon
    Ok. Looking into #120 (saving animations as GIFs) right now.
    Andy Heusser
    @andrewheusser
    sure! that would be awesome, here's another one that should be manageable if GIFs are not straightforward - ContextLab/hypertools#100
    Ryan Arredondo
    @rarredon
    Hey @andrewheusser , if you run "import matplotlib.animation as ani; print(ani.writers.list())" through python what do you get?
    Andy Heusser
    @andrewheusser
    [u'imagemagick_file', u'imagemagick', u'ffmpeg', u'ffmpeg_file']
    @rarredon
    Jamal Williams
    @jamalw
    hey! i'm finally back to using hypertools on my data. i was wondering, is it redundant to perform SRM on my data and then use the hyp.tools.align function? It looks like the hyp.tools.align function imports an SRM module but I was under the impression that it did hyperalignment which is different from SRM right?
    Jeremy Manning
    @jeremymanning

    @jamalw you can use SRM to align the data from within hypertools:
    SRM_aligned_data = hyp.tools.align(data, method='SRM')

    It'd be strange (although perhaps not "wrong" per se) to then re-align the data using hyperalignment. Technically you could do that, though:

    hyperaligned_and_SRM_aligned_data = hyp.tools.align(SRM_aligned_data)

    Jamal Williams
    @jamalw
    @jeremymanning got it! thanks. i'll have some new animations up soon!
    Jeremy Manning
    @jeremymanning
    :sparkles:
    Jamal Williams
    @jamalw
    So here's another super long video (can't remember what we discussed about putting them in this chat room but I can shorten it if necessary). Feel free to skip through. What's being shown is data from 25 subjects where one line holds 12 subjects and the other line holds 13 subjects. This data is from an mPFC roi which was acquired via the atlas tools in FSLview where I took the top 50% of voxels (probabilistic map for mPFC). Then, I used SRM to train on run1 (where subjects heard 16 songs) and tested the model on run2 (where subjects listened to the same 16 songs). Enjoy and let me know if you have any questions!
    i actually can't load it directly into the chat room so here's a dropbox link: https://www.dropbox.com/s/nngds29dyuk2ts7/srm_before_after_n25_mpfc.mp4?dl=0
    Let me know if it works properly
    Leland McInnes
    @lmcinnes
    I was curious if you would be interested in considering some alternative clustering and dimension reduction techniques -- specifically HDBSCAN for clustering, and UMAP as an alternative to t-SNEÉ
    I would be happy to help with any integration of them if you are interested in such things.
    Jeremy Manning
    @jeremymanning

    @lmcinnes sure, we'd be happy with these additions! FYI, we have some changes pending to cluster in ContextLab/hypertools#173 where we've changed some of the implementation details; also see ContextLab/hypertools#143. Overall, though, we'd be happy to have your help implementing these new algorithms (or wrappers for them)!

    The place to start is to add GitHub issues (one for adding HDBSCAN to cluster and another for adding UMAP to reduce). Then I'd recommend tackling the issues separately-- either in separate forks or separate pull requests; this will allow us to incorporate changes from one issue independently of the other. Let me or @andrewheusser know if you'd like additional guidance!

    Leland McInnes
    @lmcinnes
    Thanks, Ièll look into it and see if I can get something sorted out.
    Qihong Lu
    @qihongl
    Hi, is it possible to use hypertools in google colab?
    When animate=True, hypertools.plot() doesn't show the plot, though it works when animate=False. I was wondering if this is because google colab doesn't support animations in general or I'm doing something wrong.
    Jeremy Manning
    @jeremymanning
    if you set %matplotlib inline at the beginning of your notebook (after importing matplotlib and hypertools) animations should work
    Qihong Lu
    @qihongl
    I see! Thank you very much! I thought %matplotlib inline doesn't support animate=True I was using %matplotlib notebook
    Qihong Lu
    @qihongl
    Hey I just tried %matplotlib inline here: https://colab.research.google.com/drive/10LoEodWC7PeMYfMnEf85eK97rXNtS7lh
    I don't think it shows the animation. Am I doing anything incorrectly? btw, %matplotlib notebook also doesn't help.
    the code does work on my laptop if I use %matplotlib notebook