Repository navigation
Complete VBuffer redesign - #1650
Conversation
| VBuffer<Float> tempGrad = default(VBuffer<Float>); | ||
| for (int i = from; i < to; ++i) | ||
| { | ||
| tempGrad = new VBuffer<Float>(0, 0, tempGrad.Values, tempGrad.Indices); |
There was a problem hiding this comment.
I wasn't sure on this one. Normally when you call a function passing in a VBuffer, it is assumed that the function will return with the right result into that VBuffer. So "zeroing" it right before calling _func seemed unnecessary.
There was a problem hiding this comment.
Well, that depends. I wonder if this _func here is some sort of "accumulating" gradient, so that if you call it multiple times without a refresh it will accumulate the partial gradients for all things. That could explain this pattern. To give another example, things in VectorUtils and the like often accept a vector as both a source and destination of data (e.g., the scaling, the multiply-add-intos, and stuff like this).
In reply to: 234085400 [](ancestors = 234085400)
There was a problem hiding this comment.
Actually I tried to go hunting for it to see if the usages of this actually bear out, there are no usages of DifferentiableFunctionAggregator at all. Not sure what's up with that. This code though is probably one of the oldest parts of the codebase, so maybe it was used years ago and no one noticed when we stopped using it. To be honest I'm not even sure what it is meant to do... maaaaaaaybe we can nuke it?
In reply to: 234102794 [](ancestors = 234102794,234085400)
There was a problem hiding this comment.
I'll add this line back. I've opened #1653 to investigate removing this class since it isn't used.
| } | ||
|
|
||
| var weightsEditor = VBufferEditor.CreateFromBuffer(ref weights[0]); | ||
| var l1IntermediateWeightsEditor = VBufferEditor.CreateFromBuffer(ref l1IntermediateWeights[0]); |
There was a problem hiding this comment.
l1IntermediateWeights [](start = 89, length = 21)
Similar, I think this can be null.
|
Looks very nice in general @eerhardt, thanks for working on this! I guess you're going to nail down the test failures, and I notice we haven't yet deleted the arrays from |
e2fec50 to
327a9c9
Compare
d652a60 to
60b15df
Compare
|
This change is ready to go in. Just needs one more reviewer to approve. |
Remove last remaining usage in VectorUtils by forking CoreCLRs ArraySort algorithm to work with Spans. Fix dotnet#608
60b15df to
e5f45f5
Compare
This completes the redesign work for
VBufferby removing.Valuesand.Indicespublic arrays and converts all their usages to the new pattern. This is proposed change (4) in #608 (comment).Fixes #608