nickmcintyre / numero Goto Github PK
View Code? Open in Web Editor NEWA friendly and intuitive math library for p5.js
Home Page: https://mcintyre.io/numero/
License: MIT License
A friendly and intuitive math library for p5.js
Home Page: https://mcintyre.io/numero/
License: MIT License
The function createTensor()
and tensor instance methods seem to be working fine in global mode, but no luck with static methods. The following statement throws an error.
const domain = Tensor.range(0, width);
// ^ throws TypeError: Tensor.range is not a function
Prefixing the static method call with p5.prototype
does work. Hmm.
Tensor operations should work with p5.Vector where possible. p5.Vector could be extended to operate on Tensors.
I propose starting with a few test cases for matrix-vector operations.
NumPy's universal functions are nice and have analogs in TensorFlow.js. A core set of functions like num.add(t1, t2)
would be useful.
Forcing beginners to use num.tidy()
out of the gate steepens the learning curve. Setting the default backend to cpu
would simplify this:
const b = num.tidy(() => {
const a = createTensor([[1, 2], [3, 4]]);
const x = createTensor([5, 6]);
return a.dot(x);
});
print(b.toString());
to this:
const a = createTensor([[1, 2], [3, 4]]);
const x = createTensor([5, 6]);
const b = a.dot(x);
print(b.toString());
Let's ๐
Matrices (rank-2 tensors) should support elementary row operations. It'd be neat to use them to teach elimination.
It'd be nice to expose a manageable subset of tfjs' tensor methods.
Static methods for creating tensors likezeros()
, ones()
, eye()
(for matrices), fill()
, range()
, linspace()
, random()
(mapped to tfc.randomUniform()
), and randomGaussian()
(mapped to tfc.randomNormal()
) to begin. copy()
(mapped to tfc.clone()
) should be an instance method.
Transformations should include reshape()
and flatten()
. Static versions should return a new tensor.
concat()
, reverse()
, slice()
, split()
, stack()
, and unstack()
should work with p5.Vectors where possible. Static versions should return a new tensor.
Let's start with the basic math that overlaps with core p5.js math functions. Trigonometry should probably respond to angleMode()
. Static versions should return a new tensor.
Symbolic expressions should map to compatible functions/objects where possible. SymPy's printing system is a good example of how this might work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.