A web-based visualization and debugging platform for NuPIC

Overview

Cerebro 2

A web-based visualization and debugging platform for NuPIC.

Usage

Set up cerebro2.server to export your model state.

Then, run:

cd static
python -m SimpleHTTPServer 8000

Finally, visit the following URL in your browser:

http://localhost:8000

Screenshots

To enable taking screenshots with the p keyboard shortcut, open js/classes/abstract_visualization.js and uncomment the line under the note about screenshots.

Quicker Setup

See 'run_server.py' for a quicker setup.

Comments
  • Fixes numenta/nupic.cerebro2#35

    Fixes numenta/nupic.cerebro2#35

    Addresses issue of allowing player to go beyond number of actual iterations. Also introduces code to automatically enable/disable player buttons depending on the state of the animation.

    opened by jefffohl 18
  • Show an error message in UI when WebGL fails to initialize

    Show an error message in UI when WebGL fails to initialize

    Addresses #66.

    Let me know if this fix isn't surgical enough. And feel free to nitpick.

    Small design decisions:

    • I didn't add new WebGL detection logic. That would require creating a dummy canvas, etc.
    • The error message comes from near the point of failure, rather than assuming we know what went wrong in main.js.
    • The failure is localized to the container that fails to get populated, rather than leaving the exception uncaught. This helps avoid the red herring error messages mentioned in the original issue.
    • I didn't try to create a super-user-friendly experience. It just shows the error message in place of the canvas. Good enough for hackers.
    • To avoid duplicated try/catch for each visualization, and to avoid hypothetical broken scenarios where one visualization succeeds and the other fails:
      • I created a helper function (addVisualization) with success callbacks.
      • I store an array of historyConsumers rather than having one var per consumer (formally visualization2D, visualization3D).
      • I change the GUISync so that the master can be specified outside of the constructor, so that the main.js code doesn't trip over itself if one of the visualizations fails to create.
    opened by mrcslws 11
  • 3D View: Add camera control buttons

    3D View: Add camera control buttons

    Not sure how hard this will be, but it would great to have some buttons that will re-position the camera to pre-defined positions, such as front, top, left, right, bottom. Often times, when manipulating the view, the model can get skewed, or off screen. Clicking one of these buttons would:

    • Immediately re-position the model and/or camera so that the view is directly from that position (e.g. from the front), with edge aligned with the bounding box of the view.
    • Resize the model and/or camera so that the entire model fits within the view.

    Another control that might be nice to have would be a camera focal length slider.

    opened by jefffohl 8
  • Fixes numenta/nupic.cerebro2#61. Namespacing.

    Fixes numenta/nupic.cerebro2#61. Namespacing.

    Fixes #61.

    Attention: @chetan51

    Namespaced all global objects under Cerebro2. Also wrapped main.js code in anonymous functions to prevent global namespace pollution. This fixes the issue described in numenta/nupic.cerebro2#61 where, in the Chrome browser, the "history" object cannot be overwritten.

    bug 
    opened by jefffohl 6
  • Internal server error

    Internal server error

    Hey all,

    everytime I try to run cerebro2 (with cerebro2.server set up) I get a list of errors like (excerpt):

    127.0.0.1:47916 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/input/active_cells" - 500 Internal Server Error
     127.0.0.1:47919 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/output/predicted_cells" - 200 OK
    127.0.0.1:47917 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/output/active_columns" - 500 Internal Server Error
    127.0.0.1:47921 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/input/active_cells" - 500 Internal Server Error
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239, in process
        return self.handle()
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230, in handle
        return self._delegate(fn, self.fvars, args)
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
        return handle_class(cls)
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
        return tocall(*args)
      File "/home/mark/nupic.cerebro2.server/api/model_api.py", line 46, in GET
        return jsonResponse(readJSON(filepath))
      File "/home/mark/nupic.cerebro2.server/api/model_api.py", line 68, in readJSON
        raise error
    IOError: [Errno 2] No such file or directory: u'/tmp/cerebro2/model/states/1/output/active_columns.json'
    
    127.0.0.1:47920 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/output/active_cells" - 200 OK
     127.0.0.1:47916 - - [21/Aug/2014 17:45:35] "HTTP/1.1 GET /_model/states/1/output/predicted_cells" - 200 OK
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239, in process
        return self.handle()
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230, in handle
        return self._delegate(fn, self.fvars, args)
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
        return handle_class(cls)
      File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
        return tocall(*args)
      File "/home/mark/nupic.cerebro2.server/api/model_api.py", line 46, in GET
        return jsonResponse(readJSON(filepath))
      File "/home/mark/nupic.cerebro2.server/api/model_api.py", line 68, in readJSON
        raise error
    IOError: [Errno 2] No such file or directory: u'/tmp/cerebro2/model/states/1/output/proximal_synapses.json'
    

    Do you have any idea what the problem might be? Cheers, Mark

    bug P2 
    opened by Phlogiston90 4
  • Addresses chetan51/nupic.cerebro2#26

    Addresses chetan51/nupic.cerebro2#26

    Added camera controls to position camera in various default views. As a part of this, added an equation to calculate a reasonable distance for the camera based on the size of the model. All of this necessitated some modifications to the display of the dat.GUI elements in order to make room for the extra buttons.

    Opted not to include a Field of View slider. While this is possible, the way a particle system is built, caused the size of the particles to scale strangely, and there did not seem to be a great benefit in offering the feature. If there is interest in this, I can add the code to enable this easily.

    opened by jefffohl 3
  • Change default model URL to point to port 8080 instead of 9090

    Change default model URL to point to port 8080 instead of 9090

    8080 is the default port for a web.py application, so we should point to that from the Cerebro 2 client instead. That way, just running python server.py in Cerebro 2 server will work, rather than having to run python server.py 9090.

    Also update Cerebro 2 server README to say just python server.py instead of python server.py 9090.

    bug newbie help wanted 
    opened by chetan51 2
  • Uncaught TypeError: number is not a function in abstract_visualization.js:118

    Uncaught TypeError: number is not a function in abstract_visualization.js:118

    I am getting this error after my most recent merge from upstream. It looks like something might have changed recently with the history object? Length no longer seems to be a method? I will try to look into this more.

    bug 
    opened by jefffohl 2
  • Fixes chetan51/nupic.cerebro2#1

    Fixes chetan51/nupic.cerebro2#1

    In order to keep the slider up to date, we remove the slider and re-instantiate it after each snapshot. This could possibly cause problems in situations in which there is a very long stream, and the snapshot updates are happening very rapidly, and the user tries to move the slider as it is being updated, but this seems to work pretty well in my local tests. The only other way to approach this seemed to be to modify dat.GUI code directly, to allow for a dynamic change to be made to the max value of the slider.

    opened by jefffohl 2
  • Add Play button and speed control

    Add Play button and speed control

    Under the Iteration scrubber, there should be a Play button that automatically steps through iterations with a certain speed. Under the Play button (disabled if not playing) should be a scrubber that controls the playback speed.

    enhancement 
    opened by chetan51 2
  • Status cerebro nupic-studio?

    Status cerebro nupic-studio?

    @chetan51 Is cerebro obsoleted?

    @david-ragazzi are you reusing the code? or providing same functionality?

    or is there a chance of merging the two projects?

    question 
    opened by breznak 1
  • Implement unit tests

    Implement unit tests

    We need automated unit tests for Cerebro2. Questions:

    • What should our code coverage target be?
    • What framework to use? Jasmine? Mocha?
    • Will coveralls.io work with this project?
    • Do we want other types of tests, such as end-to-end tests?
    tests P3 
    opened by jefffohl 5
  • Optimize Javascript files

    Optimize Javascript files

    Setup a build flow, and use something like RequireJS [1] to combine all the necessary Javascript files into one minified file, so that users can just do

    <script src="cerebro2.min.js"></script>
    

    to embed Cerebro2 in their webpage.

    [1] http://requirejs.org/docs/optimization.html#wholeproject

    enhancement help wanted P4 optimization 
    opened by chetan51 2
  • Move controller manipulation code in AbstractVisualization to utilities file

    Move controller manipulation code in AbstractVisualization to utilities file

    Move controller-manipulation functions from AbstractVisualization into a separate, utility file (maybe called dat.gui.utils.js), so they're not causing clutter.

    @jefffohl

    P4 refactoring 
    opened by chetan51 0
  • Add a

    Add a "first" button to the iteration controls

    I find myself often wanting to reset the animation to the beginning. It would be nice to have a "first" button in the iteration controls that resets to the first iteration.

    enhancement help wanted P4 
    opened by chetan51 0
Owner
Numenta
Biologically inspired machine intelligence
Numenta
VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.

VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.

null 2.8k Jan 8, 2023
A package containing a lot of useful utilities for Python developing and debugging.

Vpack A package containing a lot of useful utilities for Python developing and debugging. Features Sigview: press Ctrl+C to print the current stack in

volltin 16 Aug 18, 2022
Debugging manhole for python applications.

Overview docs tests package Manhole is in-process service that will accept unix domain socket connections and present the stacktraces for all threads

Ionel Cristian Mărieș 332 Dec 7, 2022
A toolbar overlay for debugging Flask applications

Flask Debug-toolbar This is a port of the excellent django-debug-toolbar for Flask applications. Installation Installing is simple with pip: $ pip ins

null 863 Dec 29, 2022
Never use print for debugging again

PySnooper - Never use print for debugging again PySnooper is a poor man's debugger. If you've used Bash, it's like set -x for Python, except it's fanc

Ram Rachum 15.5k Jan 1, 2023
Cyberbrain: Python debugging, redefined.

Cyberbrain1(电子脑) aims to free programmers from debugging.

laike9m 2.3k Jan 7, 2023
Hypothesis debugging with vscode

Hypothesis debugging with vscode

Oliver Mannion 0 Feb 9, 2022
Sentry is cross-platform application monitoring, with a focus on error reporting.

Users and logs provide clues. Sentry provides answers. What's Sentry? Sentry is a service that helps you monitor and fix crashes in realtime. The serv

Sentry 32.9k Dec 31, 2022
An improbable web debugger through WebSockets

wdb - Web Debugger Description wdb is a full featured web debugger based on a client-server architecture. The wdb server which is responsible of manag

Kozea 1.6k Dec 9, 2022
The official code of LM-Debugger, an interactive tool for inspection and intervention in transformer-based language models.

LM-Debugger is an open-source interactive tool for inspection and intervention in transformer-based language models. This repository includes the code

Mor Geva 110 Dec 28, 2022
Arghonaut is an interactive interpreter, visualizer, and debugger for Argh! and Aargh!

Arghonaut Arghonaut is an interactive interpreter, visualizer, and debugger for Argh! and Aargh!, which are Befunge-like esoteric programming language

Aaron Friesen 2 Dec 10, 2021
Debugger capable of attaching to and injecting code into python processes.

DISCLAIMER: This is not an official google project, this is just something I wrote while at Google. Pyringe What this is Pyringe is a python debugger

Google 1.6k Dec 15, 2022
🔥 Pyflame: A Ptracing Profiler For Python. This project is deprecated and not maintained.

Pyflame: A Ptracing Profiler For Python (This project is deprecated and not maintained.) Pyflame is a high performance profiling tool that generates f

Uber Archive 3k Jan 7, 2023
Parsing ELF and DWARF in Python

pyelftools pyelftools is a pure-Python library for parsing and analyzing ELF files and DWARF debugging information. See the User's guide for more deta

Eli Bendersky 1.6k Jan 4, 2023
Code2flow generates call graphs for dynamic programming language. Code2flow supports Python, Javascript, Ruby, and PHP.

Code2flow generates call graphs for dynamic programming language. Code2flow supports Python, Javascript, Ruby, and PHP.

Scott Rogowski 3k Jan 1, 2023
AryaBota: An app to teach Python coding via gradual programming and visual output

AryaBota An app to teach Python coding, that gradually allows students to transition from using commands similar to natural language, to more Pythonic

null 5 Feb 8, 2022
Dahua Console, access internal debug console and/or other researched functions in Dahua devices.

Dahua Console, access internal debug console and/or other researched functions in Dahua devices.

bashis 156 Dec 28, 2022
Python's missing debug print command and other development tools.

python devtools Python's missing debug print command and other development tools. For more information, see documentation. Install Just pip install de

Samuel Colvin 637 Jan 2, 2023
Full featured multi arch/os debugger built on top of PyQt5 and frida

Full featured multi arch/os debugger built on top of PyQt5 and frida

iGio90 1.1k Dec 26, 2022