Comments (6)
Actually, it looks like tnp.experimental_enable_numpy_behavior()
makes everything work except for the contrib/tt
methods and randomized CP. That's not too bad...
from tensorly.
100% agreed with @aarmey that the main problems are indexing/updating elements in Tensorflow tensors. Having a verbose and error-prone syntax using update_index, while all other backends do not need this syntax, is painful.
For now #494 seems like the right move.
My concern with the numpy experimental behavior is that I have no idea how stable it is. But if the changes to existing functions are minor as you suggest, it may be worthwhile to do it anyways.
from tensorly.
One more bit of information I found—JAX still requires tensor.at[indices].set(values)
syntax if you plan to trace your code for jit or autodiff. Consequently, I don't think we can remove update_index()
just by deprecating TensorFlow.
I think with the new information here, I'd suggest:
- Moving to using
tnp.experimental_enable_numpy_behavior()
with the TensorFlow version restricted with a check - Reenabling the tests that would then function
- Deprecating mxnet (lots of issues with it)?
Alternatively we could deprecate TensorFlow with a link to an issue to collect feedback? If nobody is using it, then removing it would be easiest and best...
from tensorly.
I agree, I also prefer the last option.
from tensorly.
We in fact already use the NumPy API in the backend. I think the crux of the issue comes down to Tensorflow (1) not supporting mutation, except through the frustrating update_index
interface and (2) not supporting indexing via a list. I agree that skipping tests for specific backends is not ideal; I worry that it is creating many situations in which users will find code that doesn't work for their backend.
Incidentally, we actually skip many more tests due to issues in mxnet. I would propose deprecating that before Tensorflow given its development has stopped.
As for Tensorflow, maybe it is possible to get some of the skipped tests working? In that case I would recommend keeping it. If it is not possible to resolve the cases where we have used list-based indexing, it would be good to ensure there are clear errors for users when they encounter methods using this.
from tensorly.
Sounds like there are little downsides to using the experimental feature of TF if we are anyway considering deprecating it.
I agree @aarmey I was also reading up on JAX and looks like it's best to keep the update_index - JIT and autodiff are some of the main reasons to use that backend.
from tensorly.
Related Issues (20)
- Optional order parameter in tl.reshape can't be used with PyTorch backend HOT 4
- Further testing for preserving tensor context with operations HOT 4
- Error encountered when using tensorly.decomposition.parafac with high rank and GPU HOT 2
- Can I impute data using Tucker or CP Decomposition for categorical data? HOT 1
- make_svd_non_negative only returns the updated U matrix HOT 2
- All nan in matrix come from non negative tucker decomposition HOT 2
- Init mode == "random" does not return the correct shape in initialize_tucker HOT 3
- It appears that partial_unfold works using sparse tensors, but it is not clear in the documentation
- Better random init of factorized tensors HOT 1
- svd_interface will throw an error if the number of rows of the matrix is smaller than it's columns HOT 1
- numpy.core._exceptions._ArrayMemoryError HOT 2
- Is there any t-product implementation code in tensorly?Thanks HOT 1
- More descriptive message when random PARAFAC2 rank is infeasible given shape HOT 1
- AssertionError: `tensorly.tt_tensor.validate_tt_rank` test HOT 1
- Randomised_CP function throws a Singular Matrix error HOT 2
- Tensor Conversion in TensorLy Does Not Preserve PyTorch Tensor dtype and device Attributes
- PARAFAC2 for missing data HOT 1
- Panel Dataset Time, Company, Feature HOT 1
- No attribute "device" when using Numpy backend HOT 3
- Remove MXNet from doc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorly.