Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create plots for the input and the output of the SPA Basal Ganglia #567

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Seanny123
Copy link
Collaborator

Partially resolves #411

@Seanny123 Seanny123 added this to the 0.2 release milestone Oct 4, 2015
@tcstewar
Copy link
Collaborator

tcstewar commented Oct 5, 2015

Looks like you forgot to include components/bg_plot.py and possibly a .js file as well... :)

@Seanny123
Copy link
Collaborator Author

😊 fixed it now

Conflicts:
	nengo_gui/components/netgraph.py
	nengo_gui/components/value.py
	nengo_gui/static/components/netgraph_item.js
@Seanny123
Copy link
Collaborator Author

This pull request is ready for review, however a few caveats before you dig in:

  • It both adds legends to value plots and creates bg plots. Should this be split up into two separate pull requests?
  • The bg output plot is still present. I remember talking during a meeting about removing it and/or replacing it with something else. Can that be part of another pull request or does it need to be a part of this one?

@Seanny123
Copy link
Collaborator Author

Hmmm... Doesn't seem to be responding to edited actions on reload. Or if you edit the actions at all actually. Or re-order them...

@Seanny123
Copy link
Collaborator Author

Now responds to edits, but just gives the default values labels, which isn't good.

@Seanny123
Copy link
Collaborator Author

This pull request is ready for review again!

@tcstewar
Copy link
Collaborator

Here's an interesting bug with how the labels are generated:

  • start with examples/tutorial/21-spa-sequence.py
  • show the BG input plot (or output plot). This will have labels based on the condition part of each rule.
  • comment out one rule that's NOT the last one. So something like:
    actions = spa.Actions(
        'dot(memory, A) --> memory=B',
        'dot(memory, B) --> memory=C',
        #'dot(memory, C) --> memory=D',
        'dot(memory, D) --> memory=E',
        'dot(memory, E) --> memory=A',
        )

The remaining lines will be labelled dot(memory, A), dot(memory, B), dot(memory, C), dot(memory, D) rather than dot(memory, A), dot(memory, B), dot(memory, D), dot(memory, E)

self.label = "bg " + self.probe_target

def attach(self, page, config, uid):
super(Value, self).attach(page, config, uid)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't doing anything other than calling the constructor, I'm not sure it should be defined at all

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between this calling of the constructor and not defining it at all, is that in this call, I don't assign a label. If this were not defined, a label, which I do not want, would be assigned.

@@ -32,7 +32,13 @@ Nengo.NetGraphItem = function(ng, info, minimap, mini_item) {
this.g_networks = ng.g_networks_mini;
this.g_items = ng.g_items_mini;
}


// SPA network specific parameter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this means

@Seanny123
Copy link
Collaborator Author

I figure out the bug causing the weird label stuff.

The legend labels are being saved in the config and being reloaded regardless of their relevance, because they're saved as a list and not as a hash. So items of at the end of the list are deleted regardless of the position of the inputs are removed. To fix this, they should be saved as a hash where bg inputs are associated to specific legend labels. To accomplish this, I need to create a new class for bg-plot in JavaScript and I have to extract the legend management code from Value.js. Consequently, I won't be getting around to this for a while.

@tcstewar
Copy link
Collaborator

Consequently, I won't be getting around to this for a while.

No problem! We can put this off till 0.3... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Custom plots for Thalamus and Basal Ganglia outputs
2 participants