Element-Research / dpnn

deep extensions to nn
BSD 3-Clause "New" or "Revised" License
194 stars 82 forks source link

Check for getParameters_found on root module, too #67

Closed nhynes closed 8 years ago

nhynes commented 8 years ago

This PR enables hiding sub-modules in a container without having to set dpnn_getParameters_found on all sub-modules by checking to see if the root has already been searched. Additionally, this change makes it so that calling getParameters does not unset the user's dpnn_getParameters_found = true on the modules containing the hidden modules (i.e. those that are, themselves, not hidden and therefore placed in con.modules). This prevents a second call to getParameters from revealing what should be hidden.

An alternative but possibly less straightforward implementation is https://github.com/nhynes/dpnn/commit/3778197b54d97d7cfa6acc490303823b8d82f47a.

nicholas-leonard commented 8 years ago

@nhynes Changed your mind?

nhynes commented 8 years ago

No, I still use these changes locally but I'm not sure the use case is common enough to risk regressions in existing code!

nicholas-leonard commented 8 years ago

@nhynes Sounds good.