Closed juguma closed 8 months ago
The current implementation of the ScaleSum (which typically acts on pairs of cached and modified values) might not be intuitive and the jumping back and forth in the x-Vector is probably less efficient than working with a preordered Vector of 2-Vectors (cf. #100 where we made some tests). However, the new definition of the CacheRetrieveLayer allows for a more flexible sequence concatenation of cached values and non-cached values, which in combination with the ScaleSum leads to the required output. Hence I close this ticket.
For the extended ScaleSum (cf. #100) it is helpful to have a matching Cache-Retrieve layer, which prepares value pairs (2-Vectors) of the entered "dx"-Vector and the values of the cache at the specified indices. The current version creates a vector with cached values only before or after the entered "dx"-vector, which even with a resphape cannot be transformed into the expected (and handy) format of a Vector of 2-Vectors. I propose to define a new Cache-Retrieve-Layer-Variant, as follows:
I think the sizehint and push could be replaced by the correct allocation of the retVal Vector of 2-Vectors which is more performant(!?), but I haven't figured out how to allocate it correctly, yet.