Two questions: 1. Would APIs that operate on existing data types (rather than tensors) work just as well? 2. Could there instead be a kernel-like API that could work on things independently? Lower level APIs that enable equivalent high-level constructs is a much better place to start.
And two comments: 1. You could easily emulate 2D arrays by simply using 1D arrays and storing data in row- or column-major order. This is pretty well-known at this point, and is how C/C++ allocate multi-dimensional arrays internally. 2. Data parallelization requires special consideration, and I can assure you, machine learning isn't the only thing that could stand to benefit from this. It needs to be broad enpugh that other non-data applications can benefit from it. (Applying DOM changes from a static change list is an embarassingly parallel\* problem. So anything that could speed this up by a substantial bit could be infinitely useful to anyone using Angular, React, Ember, or any other framework out there.) \* Yes, that's a technical term. Look it up on Wikipedia. On Fri, Jan 26, 2018, 20:50 Robert Eisele <[email protected]> wrote: > Hello, > > Allocating multi-dimensional arrays in Javascript is only possible by > building each dimension individually. In addition to being a very > tedious job, a developer has no control over memory usage, which in > general is likely to be very high. > > Seeing an array algebraically as a vector, typed arrays have already > created the ability to work more efficiently and memory-consciously with > lists of numbers. A natural extension of this is not just a matrix, but > a tensor. > > I would like to suggest tensors as a native language construct in ES. > This would have the advantage that developers could write highly > parallelizable code independently of WebGL. As an API one could > introduce the following classes in analogy to typed arrays: > > - IntXTensor > - UintXTensor > - FloatXTensor > > Where X is one of {8, 16, 32, 64}. To make these tensor objects really > effective, it is necessary to introduce meaningful operations, maybe > similar to the features of TensorFlow. I think by introducing tensors in > the browser (but also node.js), a wide range of new applications open > up. For example, working with deep learning right in the browser or > calculating filters on images without having to write shaders for them. > > The most important thing probably is having a way of storing high > dimensional data in the browser without worrying about the memory > footprint, even for complex applications. > > What do you think about it? > > Robert Eisele > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

