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

Make View behave more like Module #351

Closed
wants to merge 13 commits into from
Closed

Make View behave more like Module #351

wants to merge 13 commits into from

Conversation

jnsbck
Copy link
Contributor

@jnsbck jnsbck commented Apr 24, 2024

I have added a bunch of attrs that can be accessed in Module as properties of View. Calling View.attr behaves similar to Module.attr, but only considers whatever parts of the network, cell, etc. are currently in view. This could potentially allow to run integrate on View, i.e. if one just wants to look at the soma of a cell or a single cell in a network. This would also make it easier to add a to_module util, that can take a View and turn it into a standalone module, which was suggested in #249.

Also added a groups attr, that just lists group names.

Open questions and todos are:

  • Add tests to check if View and Module work the same way!
  • Check if integration can be run on View
  • Decide how to deal with disconnected views. Potentially add _ensure_view_is_connected?
  • Remove xyzr if move_to method #320 gets merged
  • How to deal with nseg if only parts of branch are viewed or when viewing single 2 comps or 2 branch sections in 2 cells
  • rid View.nodes of unused parameters
  • handle trainable_params
  • Are all relevant / important properties accessible? Do some need to be added on CellView etc. level?
  • remove dev.ipynb

In the long term, it would be nice to make View behave more like Module without all of these properties essentially just indexing into View.pointer in some way. Imo most methods should be part of module if possible and only passed through to view, with view only showing what's in scope. While a method in module acts on the entire thing, in view it only acts on whatever is in view. This could be done by having a self.viewed_indexes / self.in_scope attr in Module, that decides what is set, where things are inserted etc. This would get rid of a lot of complexity and duplicate methods. For example would this make many hidden methods, like _record in Module obsolete. Additionally view can just be a property that returns View.nodes.

@jnsbck jnsbck linked an issue Apr 24, 2024 that may be closed by this pull request
@kyralianaka
Copy link
Contributor

move_to method #320 was just merged :)

@jnsbck
Copy link
Contributor Author

jnsbck commented Oct 10, 2024

Much better implementation in #447

@jnsbck jnsbck closed this Oct 10, 2024
@jnsbck jnsbck mentioned this pull request Oct 23, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extracting part of a cell, network etc.
2 participants