laop icon indicating copy to clipboard operation
laop copied to clipboard

Alternative

Open bolt12 opened this issue 4 years ago • 2 comments

This PR has type safe matrix construction primitives via linear maps semantics.

The new file called Alternative.hs when ready will substitute the one called Internal.hs.

I still need to refactor the other modules.

bolt12 avatar Mar 01 '20 16:03 bolt12

Now that the project compiles I ran the Benchmarks for the matrix composition and they are exactly the same. Since matrix composition does not use any of the Khatri-Rao and derivatives functions it doesn't suffer any performance impact!

However, just by running the Example.hs it's a lot slower than the previous version :cry: Just doing kr die die takes a lot of time to generate a Matrix of 36 rows...

Is there any way we can optimize the type safe matrix construction?

bolt12 avatar Mar 01 '20 17:03 bolt12

@bolt12 Yes, I suspected that this implementation would be slower.

One of the problems is that there is a lot of padding (padLeft/padRight) in the implementation of linearMap. I suggest you try to get rid of it.

snowleopard avatar Mar 01 '20 23:03 snowleopard