GithubHelp home page GithubHelp logo

Comments (5)

mikera avatar mikera commented on August 23, 2024

Confirmed - seems to be a big in NDArray assuming that the second argument is a scalar number (when it could be any shape-compatible array)

It works fine for regular persistent vectors:

(def X [[1 2] [3 4]])
(div X X)
=> [[1 1] [1 1]]

@si14 are you able to take a look and fix this one? I get the suspicion that it may affect some other functions in NDArray too

from core.matrix.

tgoossens avatar tgoossens commented on August 23, 2024

Its probably just me. But as far as I know the matrix division is not defined like that. Because matrix multiplication is not commutative.

There is no way to know whether A/B
means B^-1 * A or A * B^-1 unless a convention is made which I would strongly dislike.

from core.matrix.

mikera avatar mikera commented on August 23, 2024

@tgoossens - I agree with you that matrices can't be easily divided for the reason that you describe.

However we're talking about a slightly different operation here - div is for element-wise division. So I think it is reasonably well defined as "elements of a divided by corresponding elements of b"
(with broadcasting as necessary to make the array sizes conformant).

from core.matrix.

tgoossens avatar tgoossens commented on August 23, 2024

My bad. Should have read the documentation better.

from core.matrix.

mikera avatar mikera commented on August 23, 2024

This is fixed I think by this commit:
e5c7d0a

from core.matrix.

Related Issues (20)

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.