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

Release/v0.1.0 #6

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

Release/v0.1.0 #6

wants to merge 14 commits into from

Conversation

stephenjfox
Copy link
Owner

@stephenjfox stephenjfox commented Feb 16, 2019

  • Please check if the PR fulfills these requirements
  • The commit message follows the guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

These are covered well in the Project, but to summarize:

Deliver a version of Morph.py that delivers on its promise of easing neural network architecture refinement

  • What is the current behavior? (You can also link to an open issue here)

Crashes on bad import. Confusing documentation. Network mangling

  • What is the new behavior (if this is a feature change)?

    • Simplified API (import statements, user-land functions to call)
    • Full functionality of widening and shrinking, for nn.Conv2d and nn.Linear layers
    • A type-constrained API
    • Example architectures that can be morphed, packaged in morph._models
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Ooooh yes. Just invoke morph.once(model). The initial API made it use uncomfortable, but the new example outlines the user-centric changes proposed herein.

  • Other information:

Should not be merged until issues #2, #3, and #4 are finished, let alone others that need completion

The code that was in shrink was utility code that
  I found uses for in at least two other places
+ Satisfies my rule of three occurences
+ Led to successful porting of notebook code
But showing that some things are too granual right now and may
  be less flexible than I want them to be.
* API usage shouldn't be so dependent on passing around strings
  - That's kind of pathetic
  + Make an informed decision about what's best for the API, then
    do it.
* Since redo_layer() is so effective, use it to lower the import
  entity count.
* NIT: make_children_list should be something like 'children_as_list'
It's been missing seen the project restructure and that can
  get lumped in here
... of the project's state and intent.
* All of the pieces are there, but they still aren't connected
* That's a poor show of engineering quality
@stephenjfox stephenjfox added the enhancement New feature or request label Feb 16, 2019
@stephenjfox stephenjfox self-assigned this Feb 16, 2019
@stephenjfox stephenjfox added this to In progress in Official Alpha Launch via automation Feb 16, 2019
stephenjfox and others added 3 commits February 16, 2019 21:34
* Use more utilities, new abstraction

* Add layer inspectors

* Add errors and utils

* Calculate a new layer's size

Rather than having to reinstatiate layers, or some
  sub-optimal traversal of a neural architectures' nn.Modules,
  just do the math for 'in-size' and 'out-size' for a given
  layer to make the math easier.

* Clarify demo.py

* Trim down resize_layers in nn.widen module

* Complete resize_layers for #2

Need a 'fit_layers', for when shrinking/pruning clips out too
  many neuron connections
__Solution__: When running tests from the command line, ___always__ import the module `-m unittest` and use the verbose (`-v`) flag to see where Python is breaking up.
* Then you'll be able to trace down the problem.
* Do this a few times, and it will be reflex
* Attempt to test for #4

PyTorch's boolean comparison crap isn't useful and makes
  it a pain to test exact tensor values.
* Will resume later

* Skipping sparsify test

It's a painfully simple function that has worked every time
  I've used it.
- No it doesn't handle every edge case
+ Yes, it gets the job done and can be packaged for the general case

* Use instance `.nonzero()` instead of `torch.nonzero()`

* Fix "type-check" in layer inspectors

* WIP: Implement shrink() in terms of resize_layers()

It was as easy as I wanted it to be.
* The complexity is how to handle a given nested layer
  + Those will get implemented with a given feature
  - Need to program feature detection

TODO:
+ Implement the resizing on a layer-by-layer case, to
  make the shrinking a bit different
  + Instead of applying the data transformation uniformly,
    each layer gets
  + Those factors will be computed as 1 - percent_waste(layer)

* Lay out skeleton for the true shrinking algo #4

* shrink_layer() is simple

* Justification for giving Shrinkage a 'input_dimensions' property:

> The thought is that channel depth doesn't change the output dimensions for CNNs, and that's
  attribute we're concerned with in the convulotional case...
  * Linear layers only have two dimensions, so it's a huge deal there.
  * RNNs do linear things over 'timesteps', so it's a big deal there.
  * Residual/identity/skip-connections in CNNs need this.

> __It's decided__. The attribute stays
rishab-sharma
rishab-sharma previously approved these changes Apr 25, 2019
1. simple sequential linear model for testing
2. Simple 3-layer conv net, with a brief explanation of project goals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Official Alpha Launch
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants