GithubHelp home page GithubHelp logo

Comments (7)

ricardoV94 avatar ricardoV94 commented on July 3, 2024

the type.shape are not propagated properly

This is a nice have but not a must. PyTensor is only requires to propagate broadcastable info at write time.

In any case, the loss likely comes from the Reshape Op.

The complicated tensordot should probably be a rewrite, as I'm sure JAX has a nice support for it without reshape tricks. Numba I don't know.

Neither of these preclude just patching the current bug.

from pytensor.

ricardoV94 avatar ricardoV94 commented on July 3, 2024

the type.shape are not propagated properly

This is a nice have but not a must. PyTensor is only required to propagate broadcastable info at write time.

In any case, the loss likely comes from the Reshape Op.

The complicated tensordot should probably be a rewrite, as I'm sure JAX has a nice support for it without reshape tricks. Numba I don't know.

Neither of these preclude just patching the current bug.

from pytensor.

lucianopaz avatar lucianopaz commented on July 3, 2024

I found that I can mostly copy over the implementation from numpy. The only stuff that I had to do differently is handling broadcastable, x.type.shape and x.shape properly to ensure everything runs smoothly.

The problem is that numpy has no implementation for batched, and to be honest, it seems to me like keeping batched versions of dot and tensordot is completely pointless. @ricardoV94, what do you think?

from pytensor.

ricardoV94 avatar ricardoV94 commented on July 3, 2024

I don't recall exactly what batched was doing. It uses BatchedDot to create a Batched TensorDot or something along those lines?

from pytensor.

lucianopaz avatar lucianopaz commented on July 3, 2024

It treats the first dimension of the tensors as batches. Mostly like a crude Blockwise

from pytensor.

ricardoV94 avatar ricardoV94 commented on July 3, 2024

It treats the first dimension of the tensors as batches. Mostly like a crude Blockwise

If that is not being used anywhere in the codebase we can remove with perhaps an informative error message if anyone tries to call with the old signature. I think we can handle that better by trying to optimize Blockwise dots at compile time instead.

from pytensor.

ricardoV94 avatar ricardoV94 commented on July 3, 2024

Which dimension was assumed to be batched, the leading one? I see you mentioned it.

For backwards-compat you could also just use pt.vectorize after doing the core tensordot (may or not need to change the input axis), and still start deprecating the kwarg (in this case legacy code wouldn't be broken immediately, just probably run slower)

Not sure it's worth it!

from pytensor.

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.