mlpack icon indicating copy to clipboard operation
mlpack copied to clipboard

Remove unused `layerOutput` and `layerDelta`

Open andrewfurey21 opened this issue 6 months ago • 2 comments

layerOutput[network.size()-1] and layerDelta[0] inside MultiLayer are unused. This PR removes them.

Should I rename totalInputSize and totalOutputSize since they don't mean that with this PR?

andrewfurey21 avatar May 18 '25 11:05 andrewfurey21

Just did the few style fixes and renames there. Should I include in the comments why it's layers-1 now? Or leave it as it is.

andrewfurey21 avatar May 24 '25 12:05 andrewfurey21

We'll just let this one sit until the DAGNetwork is merged, then we can get rid of Concat and AddMerge entirely, which then makes the changes here way simpler. :+1:

rcurtin avatar Jun 16 '25 15:06 rcurtin

totalDeltaSize == totalOutputSize, make sure to remove extra logic dealing with inSize, lastLayerSize, totalDeltaSize and rename totalOutputSize. Don't initialize residual memory unless number of layers > 1.

andrewfurey21 avatar Jul 13 '25 15:07 andrewfurey21

@rcurtin @andrewfurey21 DAGNetwork was merged in https://github.com/mlpack/mlpack/pull/3944, which this PR was apparently waiting on. Is this PR ok to go in now?

conradsnicta avatar Sep 22 '25 15:09 conradsnicta

Definitely it should go in before the next release, but I'm not sure of the exact status. Looks like it needs master merged in and I think there may be a couple other small cleanups, not sure. @andrewfurey21 happy to provide a review whenever you think it's good to go. :+1:

rcurtin avatar Sep 22 '25 17:09 rcurtin

Yeah haven't forgotten about this one. There are a couple things I wanted to change on this. I'm in the middle of few things right now, but will come back when those are done.

andrewfurey21 avatar Sep 23 '25 08:09 andrewfurey21