Closed UlisseMini closed 3 years ago
So I originally wanted to just do autograd through matmul, and that's relatively easy. but now I'm focused on refactoring and improving code quality. Maybe I should merge this with master, I do have the tests passing after all
Turns out the whole premise of using storage
instead of nested arrays was stupid, yay!
You can totally backprop through ops like transpose tinygrad does it, the implementation complexity of storage
isn't worth it, combined with the bugs that will naturally come up from all the pointers and mutation if I add view
.
Trying to copy pytorch is a bad idea, (a) its written in c++ and (b) it aims to be production ready, not have a simple implementation
Why am I doing everything on a branch again? lol
matmul
autogradmatmul
so it usesview(m,1)
for vectors instead of branchingview
storage
)Tensor.new
__index
and__newindex
in terms of stridematmul
Array datatype? (forbad idea, write pretty printer instead of overwritingstorage
,size
andstride
. just a table plus pretty printing)__tostring
.Havereverted: will do inheritance instead__index
always return a tensor, combine branches into a single statementops.lua