Giter Club home page Giter Club logo

numero's People

Contributors

allcontributors[bot] avatar ashneeldas2 avatar dependabot[bot] avatar nickmcintyre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

numero's Issues

Static methods broken

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.

Interop with p5.Vector

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.

Simplify memory management

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 ๐Ÿ˜‰

Tensor methods

It'd be nice to expose a manageable subset of tfjs' tensor methods.

Creating

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

Transformations should include reshape() and flatten(). Static versions should return a new tensor.

Slicing and Joining

concat(), reverse(), slice(), split(), stack(), and unstack() should work with p5.Vectors where possible. Static versions should return a new tensor.

Operations

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.

Code generation

Symbolic expressions should map to compatible functions/objects where possible. SymPy's printing system is a good example of how this might work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.