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

Cell: Migrate Neural Network's Class inside topomodelx/nn/ #170

Closed
ninamiolane opened this issue Aug 24, 2023 · 7 comments
Closed

Cell: Migrate Neural Network's Class inside topomodelx/nn/ #170

ninamiolane opened this issue Aug 24, 2023 · 7 comments
Assignees

Comments

@ninamiolane
Copy link
Collaborator

ninamiolane commented Aug 24, 2023

What?

We consider the neural networks (not the layers, the full networks) implemented for the cell domain. These neural networks are currently implemented as Python classes in the tutorials notebooks.

We should, instead, port their implementation into the core code base, specifically into: topomodelx/nn/cell/.

Why?

The neural networks are "hidden" in the tutorials.
They might also be less unit-tested than what they could be if they were inside the core codebase.

Where?

The files to modify are:

  • tutorials/cell/*_train.ipynb
  • topomodelx/nn/cell/

NOTE: This issue only focus on layers within the cell domain. There will be other issues to port the neural network python code into the core code base for the other domains.

How?

For each file tutorials/cell/[model-name]_train.ipynb:

  • Locate the code of the Python class that defines the neural network within the ipynb notebook,
  • Create a new file topomodelx/nn/cell/[model-name].py (note the absence of any _layer suffix).
  • Copy the code of the Python class that defines the neural network there.
  • Create a new file test/nn/cell/test_[model-name].py (note the absence of any _layer suffix).
  • Add unit-tests: one test for each of the method of the neural network's Python class.
  • Make sure that the unit-tests pass and that the methods are correctly documented.
@ninamiolane ninamiolane changed the title Cell: Bring Neural Network's Class inside topomodelx/nn/ Cell: Migrate Neural Network's Class inside topomodelx/nn/ Aug 31, 2023
@ninamiolane
Copy link
Collaborator Author

Potentially consider: https://nbdev.fast.ai/

@ninamiolane
Copy link
Collaborator Author

@maneel1995 -> Need to accept the invitation

@maneelusf
Copy link
Contributor

Hi @ninamiolane , in tutorials/cell/can_train.ipynb and tutorials/cell/can_train_bis.ipynb, both the models are defined as CAN(Cellular Attention Network). I don't think they are the same as the code looks different. What would be the ideal naming convention for the test cases?

@ninamiolane
Copy link
Collaborator Author

Hi @maneelusf , keep the naming as they are (i.e. class CAN and Class CANBis), there is another GitHUb issue ( issue #158 ) whose goal is to unify can and can_bis.

Adding the high-priority label, since this task is blocking others.

@ninamiolane
Copy link
Collaborator Author

Not done yet since the PR is not merged.

@mhajij I'm marking this as in-progress. When PR #182 is merged (see my -super minor- code review comments that need to be addressed) , we'll mark it done.

@ninamiolane
Copy link
Collaborator Author

@mhajij you will need to remove the leftovers python classes of neural networks from the tutorials. They are not needed anymore: they can be imported from the corresponding files.

@ninamiolane
Copy link
Collaborator Author

Closed by PR #222

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

No branches or pull requests

3 participants