|  | Commit message (Collapse) | Author | Age | 
|---|
| | |  | 
| | |  | 
| | |  | 
| | 
| 
| 
| 
| 
| 
| 
| | No more D2 in accumulators! Paving the way for configurable sparsity of
products and arrays. The idea is to make separate monoid types for a
"product cotangent" and an "array cotangent" that can be lowered to
either a sparse monoid or a non-sparse monoid. Downsides of this
approach: lots of API duplication. | 
| | 
| 
| 
| | Remaining problem: 'add' in Compile doesn't use the D2 stuff | 
| | |  | 
| | |  | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | The derivative of 'neural' in full accum mode is pretty atrocious now; I
think this is because when you have code like this:
  \(a :: Arr 1 R) ->
    let b = a
    in let c = b
       in sum d
then because the argument, as well as both let bindings, bind a value of
array type, each will introduce an accumulator, hence resulting in three
(!) nested `with` clauses that each just contribute their result back to
their parent. This is pointless, and we should fix this. | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | |  | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | The accumulator implementation was wrong because it forgot (in accumAdd)
to take into account that values may be variably-sized. Furthermore, it
was also complexity-inefficient because it did not build up a sparse
value. Thus let's go for the Haskell-interpreter-equivalent of what a
real, fast, compiled implementation would do: just a tree with mutable
variables. In practice one can decide to indeed flatten parts of that
tree, i.e. using a tree representation for nested pairs is bad, but that
should have been done _before_ execution and for _all_ occurrences of
that type fragment, not live at runtime by the accumulator
implementation. | 
| | |  | 
| | |  | 
| | |  | 
|  |  |